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

end session scope of bean  RSS feed

 
dibs dibley
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I have a bean that will have a session scope across a number of jsp's and servlet's. It will hold a primary key parameter so as another bean can look up the info from the database to populate the form.jsp I have.
The primary key parameter will be chosen in a choice.jsp page when the user wants to update some forms, other times the user will want to add a new record to the forms.
How do i make sure that when the user is adding a new record that the 'primary key parameter ' from the last update won't be used?
Thanks in advance!
 
Winston Smith
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're storing the "primary key" parameter in a Bean, all you need do is set the Bean to session scope and use the Bean's set method to change the parameter every time the user makes a new choice. If a new user signs on, they will have a seperate session, with a seperate Bean instantiation, so one user's parameter is completely seperated from another's.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!