• Post Reply Bookmark Topic Watch Topic
  • New Topic

page directive attribute session=false, yet session created

 
Kumar Raja
Ranch Hand
Posts: 547
2
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

May be I did not understand the meaning and usage of attribute "session" in page directive. My understanding is if session=false, in page directive, then the JSP page will not participate in the session. However, I have my welcomepage as below



if I choose session=true, then both ways of accessing session works , which means the JSP page participated in the session.

But if I change the session=false, then <%= session %> fails, but <c:out value="${pageContext.request.session}"/> does not fail.

how can c:out still show the session, when session = false

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All the directive attribute does is to prevent the scripting variable from being created. The session still exists.

So, because scriptlets are obsolete, so is the page attribute.
 
Kumar Raja
Ranch Hand
Posts: 547
2
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Bear
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!