• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how do i invalidate a session with jstl?

 
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
So I left, I came home, and I ate some pie. And then I read this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic