Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how do i invalidate a session with jstl?

 
Max Tomlinson
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why does this not work?
<c:choose>
<c:when test="${session != null}">
${session.invalidate)
</c:when>
</c:choose>

thanks
Max
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's no implicit variable called session for EL ... also, you can't invoke functions through EL, you can only evaluate them unless you create your own EL function for it.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64692
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The fact that the JSTL/EL has no way to do this should be a red flag that you are probably attempting something on-page that's best placed in the controller. So, why are you waiting until you get to the page before trying to perform processing like invalidating the session?
[ February 09, 2005: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64692
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To specifically answer the question:


Why does this not work?
${session.invalidate}


As pointed out, there is no implicit session variable. But even had you written it as:





it would interpreted as a accessor for the "invalidate" property of the session scope; probably along the lines of:



Which of course isn't remotely the same as calling the invalidate() method.
[ February 09, 2005: Message edited by: Bear Bibeault ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic