ConfiguracaoPage.java 文件源码

java
阅读 39 收藏 0 点赞 0 评论 0

项目:edemocracia 作者:
private void initForm() {



        form = new Form<Void>("form") {

            private static final long serialVersionUID = 1L;

            @Override
            protected void onSubmit() {
                PortletPreferences prefs = UIUtils.getPortletPreferences();
                HtmlStripper htmlStripper = new HtmlStripper();

                try {
                    prefs.setValue("titulo", tituloProjetoLei.getModelObject());
                    prefs.setValue("tituloDescricao", tituloDescricaoProjeto.getModelObject());
                    prefs.setValue("descricaoProjeto", htmlStripper.strip(descricaoProjeto.getModelObject()));
                    prefs.setValue("habilitaPlugins", habilitaPlugins.getModelObject().toString());
                    prefs.setValue("habilitaSugestoes", habilitaSugestoes.getModelObject().toString());

                    info("Alterações realizadas com sucesso!");
                    getRequestCycle().setRequestTarget(new RedirectRequestTarget(viewUrl));
                } catch (ReadOnlyException e) {
                    error("Erro ao gravar alterações");
                    return;
                }
                try {
                    prefs.store();
                } catch (ValidatorException e) {
                    error("Erro ao gravar alterações");
                } catch (IOException e) {
                    error("Erro ao gravar alterações");
                }
            }
        };
        add(form);
    }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号