Check out the api for WicketSessionFilter, it will tell you how to make the
session available for non wicket servlets.

http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/protocol/http/servlet/WicketSessionFilter.html

On Tue, Jun 3, 2008 at 4:30 PM, Martijn Dashorst <[EMAIL PROTECTED]>
wrote:

> You can't access the Wicket Session from outside a Wicket request
> using Session.get(). It is a thread local that is maintained by the
> request cycle. If it was possible in 2.0, then that was a bug and most
> certainly a security risk.
>
> You should try to look up the Wicket session in the HttpSession of
> your servlet using the session id and wicket key.
>
> Or just store the report in the http session instead.
>
> Martijn
>
> On Tue, Jun 3, 2008 at 10:21 PM, Matthew R Hanlon <[EMAIL PROTECTED]>
> wrote:
> > Okay, I may have this all wrong, and then that's my problem.  I have an
> > application that was developed under the 2.0 branch that I recently
> migrated
> > to 1.4.  This application uses a servlet to handle requests for Jasper
> > Reports, and under 2.0 everything worked great.  I store the report
> request
> > in the user's Session, and retrieve it in the JasperReportServlet to look
> up
> > the request.  In my JasperReportServlet I was doing:
> >
> >
> >
> > public final void doGet(final HttpServletRequest servletRequest, final
> > HttpServletResponse servletResponse) throws ServletException, IOException
> >
> > {
> >
> >      String requestId =
> >
> servletRequest.getParameter(ReportingConstants.PARAMETER_NAME_REPORT_REQUEST
> > );
> >
> >      ReportRequest reportReq = null;
> >
> >      MySession session = (MySession)Session.get();
> >
> >      reportReq = session.getReportRequest(requestId);
> >
> >
> >
> >      // handle report request, etc.
> >
> > }
> >
> >
> >
> > However, in 1.4 when I do Session.get() from my JasperReportServlet I am
> > getting the error java.lang.IllegalStateException: you can only locate or
> > create sessions in the context of a request cycle.
> >
> >
> >
> > So, can I no longer get an object from my wicket Session from a
> non-wicket
> > Servlet?  I've been looking all over, and can't seem to find the right
> > answer.  Thanks for any help.
> >
> >
> >
> > Regards,
> >
> > Matthew.
> >
> >
> >
> >
>
>
>
> --
> Become a Wicket expert, learn from the best: http://wicketinaction.com
> Apache Wicket 1.3.3 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Ryan Gravener
http://twitter.com/ryangravener

Reply via email to