Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
1.5.4
-
None
Description
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 session;
}
I think it should be
public HttpSession getSession()