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.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes session attribute in page directive Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "session attribute in page directive" Watch "session attribute in page directive" New topic
Author

session attribute in page directive

swapnel surade
Ranch Hand

Joined: Mar 05, 2009
Posts: 129
Hi,

<%@page session="true" %>

I'm not getting the meaning of session attribute.
Please explain this.

Chinmaya Chowdary
Ranch Hand

Joined: Apr 21, 2008
Posts: 432
Hi, Swapnel. The page that declares <%@page session="true" %>, tells the container that this page participates in session. So the container creates session implicit object. If it is declared with "false", the container will not provide session implicit object. So, is not able to participate in the session.
swapnel surade
Ranch Hand

Joined: Mar 05, 2009
Posts: 129
what if I create session object in the scriptlet.
Will it create new session or return the same one ?
Chinmaya Chowdary
Ranch Hand

Joined: Apr 21, 2008
Posts: 432
Hi, Swapnel. If we say<%@ page session="false" %>, then the session will not available to the page, even if you call pageContext.getSession() in scriptlet.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: session attribute in page directive
 
Similar Threads
SCWCD objective question
Doubt in request.getSession(boolean) !
JSP displaying a Javabean
pass value
Session Id coming in URL for first time