This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Passing data between JSP, Bean and Servlet session  RSS feed

 
Trader Joey
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can a bean with scope "session" be made to store session related data or is it better to store the session related data in a HttpSession instance ? please advice . thanks
 
maha anna
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nikhil,
I didn't quite get your qstn. If you want to make an object available throughout the user session, get the user's session by
HttpSession userSession = request.getSession(true);
userSession.putValue("userName","Nikhil");
like that. We have to get an instance of the HttpSession to store a sessionwide obj isn't? Could you explain some more, about what you are asking for?
regds
maha anna
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!