You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Giovanni Cuccu (Created) (JIRA)" <ji...@apache.org> on 2012/01/30 12:11:10 UTC

[jira] [Created] (WICKET-4370) HttpSession getSession() in MockHttpServletRequest is not compliant with the j2ee servlet spec

HttpSession getSession() in MockHttpServletRequest is not compliant with the j2ee servlet spec
----------------------------------------------------------------------------------------------

                 Key: WICKET-4370
                 URL: https://issues.apache.org/jira/browse/WICKET-4370
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.5.4
            Reporter: Giovanni Cuccu
            Priority: Minor


The implementation of
httpRequest.getSession();
for MockHttpServletRequest seems not correct since it can return null when
the servler api specs
(http://docs.oracle.com/javaee/1.4/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

The MockHttpServletRequest implementation is

   public HttpSession getSession()
   {
       if (session instanceof MockHttpSession &&
((MockHttpSession)session).isTemporary())
       {
           return null;
       }
       return session;
   }

I think it should be 
   public HttpSession getSession()
   {
       return getSession(true);
   }



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (WICKET-4370) HttpSession getSession() in MockHttpServletRequest is not compliant with the j2ee servlet spec

Posted by "Martin Grigorov (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4370?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-4370.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 6.0.0
                   1.5.5
         Assignee: Martin Grigorov
    
> HttpSession getSession() in MockHttpServletRequest is not compliant with the j2ee servlet spec
> ----------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4370
>                 URL: https://issues.apache.org/jira/browse/WICKET-4370
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.4
>            Reporter: Giovanni Cuccu
>            Assignee: Martin Grigorov
>            Priority: Minor
>             Fix For: 1.5.5, 6.0.0
>
>
> The implementation of
> httpRequest.getSession();
> for MockHttpServletRequest seems not correct since it can return null when
> the servler api specs
> (http://docs.oracle.com/javaee/1.4/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
> The MockHttpServletRequest implementation is
>    public HttpSession getSession()
>    {
>        if (session instanceof MockHttpSession &&
> ((MockHttpSession)session).isTemporary())
>        {
>            return null;
>        }
>        return session;
>    }
> I think it should be 
>    public HttpSession getSession()
>    {
>        return getSession(true);
>    }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira