> Sessions in WebWork are stored in the HttpSession like this:
>
> ActionContext.getContext().getSession().put(key, value);
>
> so this should be trivial. Thanks a lot!
>
> I have never needed to override newRequestCycle() in the WebApplication
> class before, and it seems getHttpSession() is not available in the
> default RequestCycle implementation. How do I get a hold of the
> HttpSession object?
Something like this in your application:
private static class MyRequestCycle extends WebRequestCycle
{
public static MyRequestCycle get()
{
return (MyRequestCycle)RequestCycle.get();
}
public MyRequestCycle(WebApplication application, WebRequest
request, Response response)
{
super(application, request, response);
}
public HttpSession getHttpSession()
{
return
getWebRequest().getHttpServletRequest().getSession(false);
}
}
@Override
public RequestCycle newRequestCycle(Request request, Response response)
{
return new MyRequestCycle(this, (WebRequest)request, response);
}
Of course, you could do this in a custom Wicket session or utility
class as well if you use:
((WebRequestCycle)RequestCycle.get()).getWebRequest().getHttpServletRequest().getSession(false);
Ugly, but it works.
Eelco
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]