views:

40

answers:

1

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
sounds right (+1)
seanizer
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
@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