tags:

views:

113

answers:

1

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?

+2  A: 

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.

Don Roby
Yes you are right!
goutham