jgg
jgg

Reputation: 1136

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 shows<wicket:container wicket:id="topToolbars"><wicket:panel> tags under table element. How do I prevent showing this in the final HTML source?

Upvotes: 1

Views: 1470

Answers (1)

Don Roby
Don Roby

Reputation: 41137

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.

Upvotes: 3

Related Questions