/** * @see org.apache.wicket.jmx.MarkupSettingsMBean#getStripWicketTags() */ @Override public boolean getStripWicketTags() { return application.getMarkupSettings().getStripWicketTags(); }
/** * 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; }
/** * 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; }
@Override public void onConfigure(Component component) { super.onConfigure(component); if (!Application.get().getMarkupSettings().getStripWicketTags()) { LOG.warn("Application > MarkupSettings > StripWicketTags: setting is currently set to false. It is highly recommended to set it to true to prevent widget misbehaviors."); } }
/** * * @param openTag * @return true, if the tag shall be rendered */ private boolean needToRenderTag(final ComponentTag openTag) { // If a open-close tag has been modified to be open-body-close then a // synthetic close tag must be rendered. boolean renderTag = (openTag != null && !(openTag instanceof WicketTag)); if (renderTag == false) { renderTag = !getApplication().getMarkupSettings().getStripWicketTags(); } return renderTag; }
@Override public void onConfigure(Component component) { super.onConfigure(component); if (!Application.get().getMarkupSettings().getStripWicketTags()) { LOG.warn("Application > MarkupSettings > StripWicketTags: setting is currently set to false. It is highly recommended to set it to true to prevent widget misbehaviors."); } }
/** * * @param openTag * @return true, if the tag shall be rendered */ private boolean needToRenderTag(final ComponentTag openTag) { // If a open-close tag has been modified to be open-body-close then a // synthetic close tag must be rendered. boolean renderTag = (openTag != null && !(openTag instanceof WicketTag)); if (renderTag == false) { renderTag = !getApplication().getMarkupSettings().getStripWicketTags(); } return renderTag; }
@Override public void onConfigure(Component component) { super.onConfigure(component); if (!Application.get().getMarkupSettings().getStripWicketTags()) { LOG.warn("Application > MarkupSettings > StripWicketTags: setting is currently set to false. It is highly recommended to set it to true to prevent widget misbehaviors."); } }
if (Application.get().getMarkupSettings().getStripWicketTags())
if (Application.get().getMarkupSettings().getStripWicketTags())
@Override protected void onBeforeRender() { super.onBeforeRender(); if (getApplication().usesDevelopmentConfig() && !getApplication().getMarkupSettings().getStripWicketTags()) { log.warn("Application is in DEVELOPMENT mode && Wicket tags are not stripped," + "Some Chrome Versions will not render the GMap." + " Change to DEPLOYMENT mode || turn on Wicket tags stripping." + " See:" + " http://www.nabble.com/Gmap2-problem-with-Firefox-3.0-to18137475.html."); } }
/** * @see org.apache.wicket.Component#onRender() */ @Override protected void onRender() { super.onRender(); RuntimeConfigurationType configurationType = Application.get().getConfigurationType(); if (configurationType.equals(RuntimeConfigurationType.DEVELOPMENT) && !Application.get().getMarkupSettings().getStripWicketTags()) { log.warn("Application is in DEVELOPMENT mode && Wicket tags are not stripped," + " Firefox 3.0 will not render the OMap." + " Change to DEPLOYMENT mode || turn on Wicket tags stripping." + " See:" + " http://www.nabble.com/Gmap2-problem-with-Firefox-3.0-to18137475.html."); } }
/** * 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())); } }
/** * 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())); } }
@Override public Component resolve(final MarkupContainer container, final MarkupStream markupStream, final ComponentTag tag) { if (tag instanceof WicketTag) { WicketTag wtag = (WicketTag)tag; if (wtag.isMessageTag()) { IValueMap attributes = wtag.getAttributes(); String messageKey = attributes.getString(KEY_ATTRIBUTE); if (Strings.isEmpty(messageKey)) { throw new MarkupException( "Wrong format of <wicket:message key='xxx'>: attribute 'key' is missing"); } boolean escape = attributes.getBoolean(ESCAPE_ATTRIBUTE); final String id = wtag.getId(); MessageContainer label = new MessageContainer(id, messageKey, escape); label.setRenderBodyOnly(container.getApplication() .getMarkupSettings() .getStripWicketTags()); return label; } } // We were not able to handle the tag return null; }
@Override public Component resolve(final MarkupContainer container, final MarkupStream markupStream, final ComponentTag tag) { if (tag instanceof WicketTag) { WicketTag wtag = (WicketTag)tag; if (wtag.isMessageTag()) { IValueMap attributes = wtag.getAttributes(); String messageKey = attributes.getString(KEY_ATTRIBUTE); if (Strings.isEmpty(messageKey)) { throw new MarkupException( "Wrong format of <wicket:message key='xxx'>: attribute 'key' is missing"); } boolean escape = attributes.getBoolean(ESCAPE_ATTRIBUTE); final String id = wtag.getId(); MessageContainer label = new MessageContainer(id, messageKey, escape); label.setRenderBodyOnly(container.getApplication() .getMarkupSettings() .getStripWicketTags()); return label; } } // We were not able to handle the tag return null; }