Re: Myth or Best practice : <%@ page session="false" %>
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 - 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]
RE: Myth or Best practice : <%@ page session="false" %>
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 - 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. Allistair. > -Original Message- > From: Razi Ansari [mailto:[EMAIL PROTECTED] > Sent: 15 December 2004 14:18 > To: [EMAIL PROTECTED] > Subject: 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --- QAS Ltd. Developers of QuickAddress Software http://www.qas.com";>www.qas.com Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Download MSN Messenger emoticons and display pictures. http://ilovemessenger.msn.com/?mkt=en-sg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Myth or Best practice : <%@ page session="false" %>
You can look in the code of the generated servlet to see what the differences are when using either true or false with the session directive. >>> [EMAIL PROTECTED] 12/15/2004 8:17:55 AM >>> <%@ 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Myth or Best practice : <%@ page session="false" %>
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. Allistair. > -Original Message- > From: Razi Ansari [mailto:[EMAIL PROTECTED] > Sent: 15 December 2004 14:18 > To: [EMAIL PROTECTED] > Subject: 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --- QAS Ltd. Developers of QuickAddress Software http://www.qas.com";>www.qas.com Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Myth or Best practice : <%@ page session="false" %>
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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Myth or Best practice : <%@ page session="false" %>
Hi, If the session has not already been created then this will ensure that this jsp does not create it. If one exists already it won't destroy it but the JSP won't have access to it. I reckon it's good practice to use this, if you don't need a session, don't create it. Ta Matt -Original Message- From: Razi Ansari [mailto:[EMAIL PROTECTED] Sent: 15 December 2004 14:18 To: [EMAIL PROTECTED] Subject: 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Any opinions expressed in this E-mail may be those of the individual and not necessarily the company. This E-mail and any files transmitted with it are confidential and solely for the use of the intended recipient. If you are not the intended recipient or the person responsible for delivering to the intended recipient, be advised that you have received this E-mail in error and that any use or copying is strictly prohibited. If you have received this E-mail in error please notify the beCogent postmaster at [EMAIL PROTECTED] Unless expressly stated, opinions in this email are those of the individual sender and not beCogent Ltd. You must take full responsibility for virus checking this email and any attachments. Please note that the content of this email or any of its attachments may contain data that falls within the scope of the Data Protection Acts and that you must ensure that any handling or processing of such data by you is fully compliant with the terms and provisions of the Data Protection Act 1984 and 1998. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]