I have my own Custom session class that extends Wicket's WebSession. I want to access this Custom session class from plain servlet doPost() method. What are the ways for this?
+1
A:
I've never tried to do this, and I'm not sure it's documented anywhere, but by an experiment with remote debugging to a live wicket app, the Wicket session seems to be stored in the regular HttpSession object as an attribute with key "wicket:WicketFilter:session".
This may vary if you've setup Wicket differently than I have in some way, but it may give you an idea of how to get at the Wicket session.
Don Roby
2010-10-01 00:24:44
sounds right (+1)
seanizer
2010-10-01 08:21:30
I have found answer for this. We can access Wicket's Session from plain servlets using WicketSessionFilter class(org.apache.wicket.protocol.http.servlet.WicketSessionFilter)
goutham
2010-10-01 17:31:25
@goutham - yes, this looks right. From the comments in the code, this filter is clearly intended to provide access to wicket stuff from outside wicket. And being part of the actual wicket code, it's likely a better idea than just using an undocumented (as far as I know) attribute key.
Don Roby
2010-10-01 20:20:30