You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Razi Ansari <ra...@hotmail.com> on 2004/12/15 15:17:55 UTC

Myth or Best practice : <%@ page session="false" %>

<%@ page session="false" %>

Hello people

I wanted to enquire from the experts about something that I had read.

Is it true that inculuding the above directive in a jsp will prevent the 
session object from being
created for that jsp, hence avoiding the creation of unnecessary objects??

Or Is it just that the session object will not be available for that jsp ??

what is the opinion of gurus out here, Can the inclusion of the above 
directive be considered
as a best practice to be followed.

Pls enlighten me . All replies will be valued and appreciated.

Thnx for clicking and reading through.

Warm Regards
Razi

_________________________________________________________________
Take a break! Find destinations on MSN Travel. http://www.msn.com.sg/travel/


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Myth or Best practice : <%@ page session="false" %>

Posted by Tim Funk <fu...@joedog.org>.
Yes. By default, a session variable is implicitly created for every JSP. The 
session variable is then initialized with the exsiting session or creates a 
new session if needed.

This behavior is disabled via <%@ page session="false" %>.

But you are still allowed to code in your JSP:
<% HttpSession mySession = request.getSession(true);%>

-Tim

Razi Ansari wrote:

> <%@ page session="false" %>
> 
> Hello people
> 
> I wanted to enquire from the experts about something that I had read.
> 
> Is it true that inculuding the above directive in a jsp will prevent the 
> session object from being
> created for that jsp, hence avoiding the creation of unnecessary objects??
> 
> Or Is it just that the session object will not be available for that jsp ??
> 
> what is the opinion of gurus out here, Can the inclusion of the above 
> directive be considered
> as a best practice to be followed.
> 
> Pls enlighten me . All replies will be valued and appreciated.
> 
> Thnx for clicking and reading through.
>  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org