Given the folowing code (jdiscuss.com,
Test 3 (SCWCD1.4), Question 8):
<% Integer count = (Integer) request.getSession(false).getAttribute("count");
if(count != null )
{
out.println(count);
}
else request.getSession(false).setAttribute("count", new Integer(1));
%>
WHY a new session is created (and the count attribute set) since the method getSession(false) is called? I thought that only getSession() and getSession(true) create a new session !!!
I did the test by putting this code in a very new
jsp and indeed after its execution there is a session (isNew returns true on it) with the attribute inside !
Thanks in advance