Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Are beans also destroyed with session invalidate()?  RSS feed

 
Luanne Coutinho
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a login JSP which creates a new session and puts the username into it.
My other JSP's also have page session=true, and each of them uses a bean. For example,
<jsp:useBean id="transferbean" class="transactions.transferBean" scope="session"/>
My logout JSP calls session.invalidate() and returns the user to the login page.
My question is- does the session.invalidate() call also destroy the transferbean data? The user will not close his browser window after logging out- he may choose to log in again as a different user. Will he have a new transferbean created for him, or will the previous transferbean data persist?
Thanks
Luanne
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Once the session goes out of scope(and if there are no other references to the beans) they will become subject to garbage collection. Regardless of exactly when they are destroyed, when a new session is created, its attribute map will be empty.
[ February 25, 2004: Message edited by: Bear Bibeault ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!