• 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

Catch Session Timeout with Bean

 
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I'm trying to use a Bean called SessionListener, which implements HttpSessionBindingListener. I can catch binding and unbinding events, however, I'm not sure how these work in the context of a bean. If I understand session correctly, everytime you refresh a page, it does not create a new session, yet my bean continually calls the valueBound function to indicate binding to a session. I'm using the <jsp:useBean ...> tag to
include my bean in every page. If anyone can explain the use of the
HttpSessionBindingListener, I'd greatly appreciate it.
Thanks!
WS
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are on the right track.
You just need to give the bean "session" scope in the useBean tag. The default scope is "page" - causing a new bean to be created and bound with every page as you are seeing.
Bill
 
You know it is dark times when the trees riot. I think this tiny ad is their leader:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic