Platinum Partner
java,wicket,jee 6,servlet 3.0 annotations

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;


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 {}

While, for JEE 5 version, the equivalent web.xml file is:

<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>

 

{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}