/** * configure wicket markup settings * * @param application current application */ private static void configureMarkupSettings(Application application) { MarkupSettings markupSettings = application.getMarkupSettings(); // wicket markup leads to ui problems because css selectors doesn't match. markupSettings.setStripWicketTags(true); }
@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()); }
/** * @see org.apache.wicket.jmx.MarkupSettingsMBean#getStripWicketTags() */ @Override public boolean getStripWicketTags() { return application.getMarkupSettings().getStripWicketTags(); }
/** * 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()); }
application.getMarkupSettings().setDefaultMarkupEncoding(encoding); application.getMarkupSettings().setStripWicketTags(true);
forEach(cls -> MetaDataRoleAuthorizationStrategy.authorize(cls, Constants.ROLE_AUTHENTICATED)); getMarkupSettings().setStripWicketTags(true); getMarkupSettings().setCompressWhitespace(true);
/** * @throws UnsupportedEncodingException * @see org.apache.wicket.jmx.MarkupSettingsMBean#setDefaultMarkupEncoding(java.lang.String) */ @Override public void setDefaultMarkupEncoding(final String encoding) throws UnsupportedEncodingException { // test encoding is available "".getBytes(encoding); application.getMarkupSettings().setDefaultMarkupEncoding(encoding); }
/** * Constructor. * * @param id * Component id * @param application * The application to view */ public ApplicationView(final String id, final Application application) { super(id); // Basic attributes add(new Label("name", application.getName())); add(new Label("componentUseCheck", "" + application.getDebugSettings().getComponentUseCheck())); add(new Label("compressWhitespace", "" + application.getMarkupSettings().getCompressWhitespace())); add(new Label("stripComments", "" + application.getMarkupSettings().getStripComments())); add(new Label("stripWicketTags", "" + application.getMarkupSettings().getStripWicketTags())); add(new Label("bufferResponse", "" + application.getRequestCycleSettings().getBufferResponse())); add(new Label("resourcePollFrequency", "" + application.getResourceSettings().getResourcePollFrequency())); add(new Label("versionPages", "" + application.getPageSettings().getVersionPagesByDefault())); } }
/** * @see org.apache.wicket.jmx.MarkupSettingsMBean#setStripComments(boolean) */ @Override public void setStripComments(final boolean stripComments) { application.getMarkupSettings().setStripComments(stripComments); }
@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); }); }
getMarkupSettings().setDefaultMarkupEncoding("utf-8"); final MyAuthorizationStrategy authStrategy = new MyAuthorizationStrategy(); getSecuritySettings().setAuthorizationStrategy(authStrategy); if (isStripWicketTags() == true) { log.info("Strip Wicket tags also in development mode at default (see context.xml)."); Application.get().getMarkupSettings().setStripWicketTags(true);
private void setUp(boolean turnOnSerializationCheck) { getApplication().getMarkupSettings().setDefaultMarkupEncoding(StandardCharsets.UTF_8.name()); if (turnOnSerializationCheck) { WicketSerializationDebugUtil.configurePageSerializationDebug(getApplication(), getClass()); } }
/** * Constructor. * * @param id * Component id * @param application * The application to view */ public ApplicationView(final String id, final Application application) { super(id); // Basic attributes add(new Label("name", application.getName())); add(new Label("componentUseCheck", "" + application.getDebugSettings().getComponentUseCheck())); add(new Label("compressWhitespace", "" + application.getMarkupSettings().getCompressWhitespace())); add(new Label("stripComments", "" + application.getMarkupSettings().getStripComments())); add(new Label("stripWicketTags", "" + application.getMarkupSettings().getStripWicketTags())); add(new Label("bufferResponse", "" + application.getRequestCycleSettings().getBufferResponse())); add(new Label("resourcePollFrequency", "" + application.getResourceSettings().getResourcePollFrequency())); add(new Label("versionPages", "" + application.getPageSettings().getVersionPagesByDefault())); } }
/** * 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); }
/** * @see org.apache.wicket.jmx.MarkupSettingsMBean#setStripWicketTags(boolean) */ @Override public void setStripWicketTags(final boolean stripWicketTags) { application.getMarkupSettings().setStripWicketTags(stripWicketTags); } }
@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(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()); }
/** * Says if the given tag can be handled as a raw markup. * * @param tag * the current tag. * @return true if the tag can be handled as raw markup, false otherwise. */ private boolean canRenderRawTag(MarkupElement tag) { boolean isWicketTag = tag instanceof WicketTag; boolean stripTag = isWicketTag ? Application.get().getMarkupSettings().getStripWicketTags() : false; return !stripTag; }
@Before public void setUp() { tester = new WicketTester(); tester.getApplication().getMarkupSettings().setDefaultMarkupEncoding("utf-8"); page = new DummyPage(); page.setTypeBuilder(this::buildBaseType); page.setInstanceCreator(this::createAndPopulateInstance); tester.startPage(page); form = tester.newFormTester("form"); }