This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
I have a very simple JSP page that checks to see if the user is accessing the page from the context of a session and prints a message indicating that a session has been found. But I would think when I access the JSP from a new broswer that the session should not be found, but it is. HttpSession session = request.getSession( false); if( session == null){ print(No session found) else { print(Found session!) } The session should not be found on the first time accessing the page since no session was ever created. Anyone? thanks SAF [This message has been edited by SAFROLE YUTANI (edited November 16, 2001).]
Tony Alicea
Desperado
Sheriff
Joined: Jan 30, 2000
Posts: 3219
posted
0
The JSP engine will create a session for the JSP. That's why session is one of the implicit objects found in the JSP. It is in Servlets that the method request.getSession(boolean) is useful.
Tony Alicea Senior Java Web Application Developer, SCPJ2, SCWCD
SAFROLE YUTANI
Ranch Hand
Joined: Jul 06, 2001
Posts: 257
posted
0
I understand that. I know the implicit "session" object exists, but the problem with this is that the JSP will create a new session for you even if the client accesses the JSP without a session. I need explicit control over the session for my application, and I just determined how to do it... Add this directive to the JSP and the implicit session object disappears... <%@ page session="false" %> SAF