Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Tips : Wicket and JEE 6 With Servlet 3.0 Annotations

DZone's Guide to

Tips : Wicket and JEE 6 With Servlet 3.0 Annotations

· Java Zone ·
Free Resource

Verify, standardize, and correct the Big 4 + more– name, email, phone and global addresses – try our Data Quality APIs now at Melissa Developer Portal!

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>

 

Developers! Quickly and easily gain access to the tools and information you need! Explore, test and combine our data quality APIs at Melissa Developer Portal – home to tools that save time and boost revenue. Our APIs verify, standardize, and correct the Big 4 + more – name, email, phone and global addresses – to ensure accurate delivery, prevent blacklisting and identify risks in real-time.

Topics:

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}