How to hide wicket container and panel tags in the final output html
I am using Wicket's DataTable for table creation. When I see the souce code of the final HTML file, it sh开发者_高级运维ows<wicket:container wicket:id="topToolbars"><wicket:panel>
tags under table element. How do I prevent showing this in the final HTML source?
If you run your Wicket application in deployment mode, these tags will be stripped on rendering. They're shown in development mode.
This mode is controlled by an init parameter. If you're using a WicketFilter
as is most commonly recommended these days, you can set this in web.xml
by
<filter>
<filter-name>WicketFilter</filter-name>
<filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
<init-param>
<param-name>configuration</param-name>
<param-value>deployment</param-value>
</init-param>
</filter>
Your filter might of course have other init params, as mine does, but I've omitted them here.
I believe the same parameter applies if your using the WicketServlet
. The behavior can also be controlled by other means, such as setting a system property, or by overriding getConfigurationType
in your WebApplication
subclass, but this is likely the easiest way.
This parameter defaults to "development", which gives what you're seeing.
精彩评论