private void configureAccessDeniedPage(ApplicationSettings applicationSettings, List<WicketClassCandidate<Page>> accessDeniedPageCandidates, Builder builder) { Class<Page> candidate = null; if(accessDeniedPageCandidates.size() > 0) { if(accessDeniedPageCandidates.size() == 1){ WicketClassCandidate<Page> accessDeniedPage = accessDeniedPageCandidates.get(0); candidate = accessDeniedPage.getCandidate(); applicationSettings.setAccessDeniedPage(accessDeniedPage.getCandidate()); } else { throwExceptionOnMultipleAnnotations(WicketAccessDeniedPage.class, accessDeniedPageCandidates); } } builder.withDetail("accessDeniedPage", candidate); }
private void configureAccessDeniedPage(ApplicationSettings applicationSettings, List<WicketClassCandidate<Page>> accessDeniedPageCandidates, Builder builder) { Class<Page> candidate = null; if(accessDeniedPageCandidates.size() > 0) { if(accessDeniedPageCandidates.size() == 1){ WicketClassCandidate<Page> accessDeniedPage = accessDeniedPageCandidates.get(0); candidate = accessDeniedPage.getCandidate(); applicationSettings.setAccessDeniedPage(accessDeniedPage.getCandidate()); } else { throwExceptionOnMultipleAnnotations(WicketAccessDeniedPage.class, accessDeniedPageCandidates); } } builder.withDetail("accessDeniedPage", candidate); }
@Override public void init() { super.init(); getMarkupSettings().setStripWicketTags(true); getMarkupSettings().setStripComments(true); getApplicationSettings().setAccessDeniedPage(Page403.class); getApplicationSettings().setPageExpiredErrorPage(Page410.class); getMarkupSettings().setDefaultMarkupEncoding(StandardCharsets.UTF_8.name()); setHeaderResponseDecorator(r -> new JavaScriptFilteredIntoFooterHeaderResponse(r, SingularTemplate.JAVASCRIPT_CONTAINER)); getComponentInstantiationListeners().add(new SpringComponentInjector(this)); new AnnotatedMountScanner().scanPackage("org.opensingular.studio").mount(this); List<IStringResourceLoader> stringResourceLoaders = getResourceSettings().getStringResourceLoaders(); stringResourceLoaders.add(0, new ClassStringResourceLoader(appConfig.getClass())); getComponentOnConfigureListeners().add(component -> { boolean outputId = !component.getRenderBodyOnly(); component.setOutputMarkupId(outputId).setOutputMarkupPlaceholderTag(outputId); }); }
@Override public void init() { super.init(); getRequestCycleSettings().setTimeout(Duration.minutes(5)); getRequestCycleListeners().add(new SingularServerContextListener()); Locale.setDefault(new Locale("pt", "BR"));//NOSONAR getApplicationSettings().setAccessDeniedPage(Error403Page.class); getApplicationSettings().setPageExpiredErrorPage(Page410.class); // Don't forget to check your Application server for this getApplicationSettings().setDefaultMaximumUploadSize(Bytes.megabytes(10)); getMarkupSettings().setStripWicketTags(true); getMarkupSettings().setStripComments(true); getMarkupSettings().setDefaultMarkupEncoding(StandardCharsets.UTF_8.name()); getComponentOnConfigureListeners().add(component -> { boolean outputId = !component.getRenderBodyOnly(); component.setOutputMarkupId(outputId).setOutputMarkupPlaceholderTag(outputId); }); getComponentInstantiationListeners().add(new SpringComponentInjector(this, getApplicationContext(), true)); new SingularAnnotatedMountScanner().mountPages(this); if (RuntimeConfigurationType.DEVELOPMENT == getConfigurationType()) { getDebugSettings().setComponentPathAttributeName("wicketdebug"); WicketSerializationDebugUtil.configurePageSerializationDebug(this, this.getClass()); } }
@Override public void init() { super.init(); getRequestCycleSettings().setTimeout(Duration.minutes(5)); getRequestCycleListeners().add(new SingularServerContextListener()); Locale.setDefault(new Locale("pt", "BR"));//NOSONAR getApplicationSettings().setAccessDeniedPage(Error403Page.class); getApplicationSettings().setPageExpiredErrorPage(Page410.class); // Don't forget to check your Application server for this getApplicationSettings().setDefaultMaximumUploadSize(Bytes.megabytes(10)); getMarkupSettings().setStripWicketTags(true); getMarkupSettings().setStripComments(true); getMarkupSettings().setDefaultMarkupEncoding(StandardCharsets.UTF_8.name()); getComponentOnConfigureListeners().add(component -> { boolean outputId = !component.getRenderBodyOnly(); component.setOutputMarkupId(outputId).setOutputMarkupPlaceholderTag(outputId); }); getComponentInstantiationListeners().add(new SpringComponentInjector(this, getApplicationContext(), true)); new SingularAnnotatedMountScanner().mountPages(this); if (RuntimeConfigurationType.DEVELOPMENT == getConfigurationType()) { getDebugSettings().setComponentPathAttributeName("wicketdebug"); WicketSerializationDebugUtil.configurePageSerializationDebug(this, this.getClass()); } }
@Override public void init() { super.init(); setPageManagerProvider(new RequirementPageManagerProvider(this)); getStoreSettings().setMaxSizePerSession(Bytes.megabytes(20)); getRequestCycleSettings().setTimeout(Duration.minutes(5)); getRequestCycleListeners().add(new SingularRequirementContextListener()); Locale.setDefault(new Locale("pt", "BR"));//NOSONAR getApplicationSettings().setAccessDeniedPage(Page403.class); getApplicationSettings().setPageExpiredErrorPage(Page410.class); // Don't forget to check your Application server for this getApplicationSettings().setDefaultMaximumUploadSize(Bytes.megabytes(10)); getMarkupSettings().setStripWicketTags(true); getMarkupSettings().setStripComments(true); getMarkupSettings().setDefaultMarkupEncoding(StandardCharsets.UTF_8.name()); getComponentOnConfigureListeners().add(component -> { boolean outputId = !component.getRenderBodyOnly(); component.setOutputMarkupId(outputId).setOutputMarkupPlaceholderTag(outputId); }); getComponentInstantiationListeners().add(new SpringComponentInjector(this, getApplicationContext(), true)); new SingularAnnotatedMountScanner().mountPages(this); if (RuntimeConfigurationType.DEVELOPMENT == getConfigurationType()) { getDebugSettings().setComponentPathAttributeName("wicketdebug"); WicketSerializationDebugUtil.configurePageSerializationDebug(this, this.getClass()); } }
getApplicationSettings().setAccessDeniedPage(AccessDeniedPage.class);
@Override public void init() { super.init(); getRequestCycleSettings().setTimeout(Duration.minutes(5)); getRequestCycleListeners().add(new SingularServerContextListener()); Locale.setDefault(new Locale("pt", "BR")); getApplicationSettings().setAccessDeniedPage(Error403Page.class); getApplicationSettings().setPageExpiredErrorPage(Page410.class); // Don't forget to check your Application server for this getApplicationSettings().setDefaultMaximumUploadSize(Bytes.megabytes(10)); getMarkupSettings().setStripWicketTags(true); getMarkupSettings().setStripComments(true); getMarkupSettings().setDefaultMarkupEncoding("UTF-8"); getComponentOnConfigureListeners().add(component -> { boolean outputId = !component.getRenderBodyOnly(); component.setOutputMarkupId(outputId).setOutputMarkupPlaceholderTag(outputId); }); if (applicationContext != null) { getComponentInstantiationListeners().add(new SpringComponentInjector(this, applicationContext, true)); } else { getComponentInstantiationListeners().add(new SpringComponentInjector(this)); applicationContext = WebApplicationContextUtils.getWebApplicationContext(getServletContext()); } new AnnotatedMountScanner().scanPackage("org.opensingular").mount(this); for (String packageName : getPackagesToScan()) { new AnnotatedMountScanner().scanPackage(packageName).mount(this); } getDebugSettings().setComponentPathAttributeName("wicketpath"); }
getApplicationSettings().setAccessDeniedPage(AccessDeniedPage.class);