According to the HttpServletRequest API, a call to getSession() creates a
new session if one has not been created. And a call to getSession(boolean)
does not create a new one if none exists.
As implemented in version .4, getSession() returns a session only if one
was previously set by setSession(), and getSession(false) will return a
session only if getSession() has been called before (regardless of whether
there was already a session in place).
I think this patch to the two methods would fix it:
public HttpSession getSession()
{
if (session == null) {
session = new MockHttpSession();
}
return session;
}
public HttpSession getSession(boolean create)
{
if(!create) return session;
return getSession();
}
The bug may also be in the WebMockObjectFactory.create*MockObjects*
methods, but I don't know those methods well enough to be able to tell.
Alwin Ibba
None
None
Public
|
Date: 2008-01-22 06:26
|
| Field | Old Value | Date | By |
|---|---|---|---|
| status_id | Open | 2008-01-22 06:26 | aibba |
| close_date | - | 2008-01-22 06:26 | aibba |
| assigned_to | nobody | 2008-01-22 06:26 | aibba |
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use