The implicit scripting variable called session is unavailable. If you still want access to the session - a JSP scriptlet *must* explicilty ask for it.

HttpSession mySession = request.getSession();

-Tim

Razi Ansari wrote:


Thnx for the reply people, one thing that Andreas pointed out to me from the spec :


"Indicates that the page requires participation in an (HTTP)session.
If true then the implicit script language variable named session
of type javax.servlet.http.HttpSession references the
current/new session for the page.
If false then the page does not participate in a session; the
session implicit variable is unavailable, and any reference to
it within the body of the JSP page is illegal and shall result in
a fatal translation error.
efault is true."



it says that the session is unavailabe, now is it for that page and that page cannot participate in the session or the session is not created at all for that page and hence saving the session object instantiation.

Razi


From: "Allistair Crossley" <[EMAIL PROTECTED]>
Reply-To: "Tomcat Users List" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Subject: RE: Myth or Best practice : <%@ page session="false" %>
Date: Wed, 15 Dec 2004 14:53:04 -0000

In terms of Jasper, Tomcat's JSP engine, it appears that a HttpSession is set to null if session="false" therefore no instance is made.

In terms of the JSP Spec, session="true" by default.

In terms of whether it is best practice to set session="false" when yuo know you don't need a session I have no idea. I suppose it makes sense if it saves an instantiation of HttpSession, I've never done it.

Perhaps a Jasper dev/others can comment.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to