Did you know? DZone has great portals for Python, Cloud, NoSQL, and HTML5!

Moez has posted 3 posts at DZone. View Full User Profile

How to Use Wicket With JEE6

12.30.2010
Email
Views: 4258
  • submit to reddit

Since JEE6 we no longer need a deployment descriptor (web.xml), so how do we declare the necessary configurations of Wicket?

Solution: Create an empty class that inherits from WicketFilter and annotated with the necessary config.

import javax.servlet.annotation.WebFilter;
import javax.servlet.annotation.WebInitParam;
import org.apache.wicket.protocol.http.WicketFilter;


@WebFilter(value = "/*",
initParams = { @WebInitParam(name = "applicationClassName", value = "tn.blog.dev.MyApplication")
, @WebInitParam(name="wicket.configuration", value="deployment")})
public class MyFilter extends WicketFilter{

}
 

Note:You can add as many prameters as you want.

3
Your rating: None Average: 3 (4 votes)
Published at DZone with permission of its author, Moez Ben Rhouma.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Ronald Miura replied on Thu, 2010/12/30 - 5:41am

... or create a web.xml file, like you've always done.

Moez Ben Rhouma replied on Thu, 2010/12/30 - 9:53am in response to: ronaldtm

Of course, but in jee 6, the web.xml isn't mandatory so we can use the annotation + wicket filter

Alexis MP replied on Thu, 2010/12/30 - 12:25pm

Or use web fragments

Yogendra Rampuria replied on Thu, 2010/12/30 - 11:58pm in response to: alexismp

Alexis you rock!! Thanks for the link. I was trying to recall where I saw this thing. I bet this is the best way to use frameworks in JEE6 (until frameworks come up with web-fragments in their jars ;))

Slim Ouertani replied on Sat, 2011/01/01 - 5:50am

Great, moez may be see something similaira here http://java.dzone.com/tips/tips-wicket-and-jee-6

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.