Hi Martin,
    done.
https://issues.apache.org/jira/browse/WICKET-4370
ciao,
    Giovanni

In
>  my code I was using
>      HttpSession httpSession=httpRequest.getSession();
>  which works fine within the real servlet  container (i.e. tomcat) but fails
>  when I use WicketTester
>  In order to make wicketteset work I had to change the previous line to:
>      HttpSession httpSession=httpRequest.getSession(true);
>  But if I look at the servler api specs
>  (http://docs.oracle.com/javaee/1.4/api/) the api says:
>
>  public HttpSession getSession()
>  Returns the current session associated with this request, or if the request
>  does not have a session, creates one.
>
>  So as far as I understand
>  httpRequest.getSession(); and httpRequest.getSession(true); are equivalent
>
>  If my assumption is correct the MockHttpServletRequest implementation is
>  incorrect since it returns null in my case.
>  The code in the mock class is the following one
>      public HttpSession getSession()
>      {
>          if (session instanceof MockHttpSession&&
>  ((MockHttpSession)session).isTemporary())
>          {
>              return null;
>          }
>          return session;
>      }


--
Giovanni Cuccu
CUP 2000 Spa
Via del Borgo di S. Pietro, 90/c - 40126 Bologna
e-mail: giovanni.cuccu _at_ cup2000.it


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to