wood burning stoves 2.0*
The moose likes JSP and the fly likes how do i invalidate a session with jstl? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "how do i invalidate a session with jstl?" Watch "how do i invalidate a session with jstl?" New topic
Author

how do i invalidate a session with jstl?

Max Tomlinson
Ranch Hand

Joined: Jul 17, 2001
Posts: 365
Why does this not work?
<c:choose>
<c:when test="${session != null}">
${session.invalidate)
</c:when>
</c:choose>

thanks
Max
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
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.


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61106
    
  66

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 ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61106
    
  66

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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how do i invalidate a session with jstl?