/** * @see org.apache.wicket.jmx.MarkupSettingsMBean#setStripComments(boolean) */ @Override public void setStripComments(final boolean stripComments) { application.getMarkupSettings().setStripComments(stripComments); }
/** * Factory method for that can be used to add additional configuration to this plugin. * <p> * Overrides should call {@code super.onConfigure()}. * * @param application * the application */ protected void onConfigure(final WebApplication application) { set(application, this); ApplicationExtensions.setDefaultDebugSettingsForDevelopment(application); // Adds the references from source code to the browser to reference in eclipse.... // If you want to add WicketSource capabilities overwrite this method with a super call and // add the following... // WicketSource.configure(application); application.getMarkupSettings().setStripComments(false); application.getMarkupSettings().setCompressWhitespace(false); application.getMarkupSettings().setStripWicketTags(false); }
@Override protected void init() { super.init(); getMarkupSettings().setStripWicketTags(true); getMarkupSettings().setStripComments(true); getMarkupSettings().setDefaultMarkupEncoding(StandardCharsets.UTF_8.name()); setHeaderResponseDecorator(r -> new JavaScriptFilteredIntoFooterHeaderResponse(r, SingularTemplate.JAVASCRIPT_CONTAINER)); getComponentInstantiationListeners().add(new SpringComponentInjector(this)); new SingularAnnotatedMountScanner().mountPages(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); }); getRequestCycleListeners().add(new SingularCsrfPreventionRequestCycleListener()); }
@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(WebApplication webApplication) { MarkupSettings markupSettings = webApplication.getMarkupSettings(); if(props.getDefaultMarkupEncoding() != null){ markupSettings.setDefaultMarkupEncoding(props.getDefaultMarkupEncoding()); } markupSettings.setAutomaticLinking(props.isAutomaticLinking()); markupSettings.setCompressWhitespace(props.isCompressWhitespace()); markupSettings.setStripComments(props.isStripComments()); markupSettings.setStripWicketTags(props.isStripWicketTags()); markupSettings.setThrowExceptionOnMissingXmlDeclaration(props.isThrowExceptionOnMissingXmlDeclaration()); wicketEndpointRepository.add(new WicketAutoConfig.Builder(this.getClass()) .withDetail("properties", props) .build()); }
@Override public void init(WebApplication webApplication) { MarkupSettings markupSettings = webApplication.getMarkupSettings(); if(props.getDefaultMarkupEncoding() != null){ markupSettings.setDefaultMarkupEncoding(props.getDefaultMarkupEncoding()); } markupSettings.setAutomaticLinking(props.isAutomaticLinking()); markupSettings.setCompressWhitespace(props.isCompressWhitespace()); markupSettings.setStripComments(props.isStripComments()); markupSettings.setStripWicketTags(props.isStripWicketTags()); markupSettings.setThrowExceptionOnMissingXmlDeclaration(props.isThrowExceptionOnMissingXmlDeclaration()); wicketEndpointRepository.add(new WicketAutoConfig.Builder(this.getClass()) .withDetail("properties", props) .build()); }
@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()); } }
@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"); }
/** * Sets the deployment settings for deployment mode for the given application. * * @param application * the application to set the settings */ public static void setDeploymentModeConfiguration(final Application application) { application.getMarkupSettings().setStripComments(true); // The resources are never polled. This are properties, html, // css, js files. application.getResourceSettings().setResourcePollFrequency(null); application.getResourceSettings() .setJavaScriptCompressor(new DefaultJavaScriptCompressor()); // set the behavior if an missing resource is found... application.getResourceSettings().setThrowExceptionOnMissingResource(false); // debug settings... application.getDebugSettings().setComponentUseCheck(false); application.getDebugSettings().setAjaxDebugModeEnabled(false); application.getDebugSettings().setDevelopmentUtilitiesEnabled(false); application.getDebugSettings().setOutputMarkupContainerClassName(false); application.getDebugSettings().setLinePreciseReportingOnAddComponentEnabled(false); application.getDebugSettings().setLinePreciseReportingOnNewComponentEnabled(false); }
getMarkupSettings().setStripComments(true); getMarkupSettings().setStripWicketTags(true);