Tips : Wicket and JEE 6 With Servlet 3.0 Annotations
JEE 6 and especially Servlet 3.0 introduce many features such as pluggability and asynchronous processing. In this post, I will show a how to use Wicket filter with servlet 3.0 annotations.
The deployment descriptor web.xml isn't mandatory for JEE 6 and one of the best way to declare wicket filter is by using this concise declaration :
package com.jtunisie.wicket;While, for JEE 5 version, the equivalent web.xml file is:
import org.apache.wicket.protocol.http.WicketFilter;
import javax.servlet.annotation.WebFilter;
import javax.servlet.annotation.WebInitParam;
@WebFilter(value = "/*",
initParams = { @WebInitParam(name = "applicationClassName", value = "com.jtunisie.wicket.Application")})
public final class MyWicketFilter extends WicketFilter {}
<filter>
<filter-name>WicketApplication</filter-name>
<filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
<init-param>
<param-name>applicationClassName</param-name>
<param-value>com.jtunisie.wicket.Application</param-value>
</init-param>
<init-param>
<param-name>configuration</param-name>
<param-value>deployment</param-value>
</init-param>
<init-param>
<param-name>wicket.configuration</param-name>
<param-value>deployment</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>WicketApplication</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
(3 votes)
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)




