On Monday 11 June 2007 3:58 pm, Eelco Hillenius escreveu: > > I would like to access HttpSession attributes from a wicket WebSession > > object. Is this possible? > > > > To be specific my WebSession subclass has a getUser() method. This > > user is stored as the session variable "user". > > Note that (Web)Session is an abstraction. If your session store backs > on HttpSession (like the default implementation does), you can provide > your own session object, and let that call super.get/setAttribute. > > public class MySession extends WebSession { > ... > > public User getUser() { > return (User)getAttribute("my.user.key"); > } > ... > }
But doesn't the SessionStore.getAttribute turn that into httpSession.getAttribute(getSessionAttributePrefix(webRequest) + name) In HttpSessionStore getSessionAttributePrefix looks like: "wicket:" + servletPath + ":" So if the old skool app puts "my.user.key" into it's session, wicket will be looking up "wicket:servletPath:my.user.key" and won't find anything? ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user