• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to put all user info into session?

 
Yashnoo lyo
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone:
I have a login page.I want to put all the user information into user's session if the user logon successfully.How can I do it?
I means that if the user input the "name" and "password" is correct then put the user's address,age,registetime,city,lastname ..etc into user's session.
Thks. :roll:
 
Sainudheen Mydeen
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Create a user object and set all values to it. Then set user object to the session. (session.setAttribute("user",user))
-----------
Sainudheen
 
Yashnoo lyo
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you

You means that I output all the user info from database into the value object? Then add it to session.Mybe I can use a Vector or ArrayList.Which is better?
 
Sainudheen Mydeen
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may create a user bean with getter/setter and use it.

--------------
Sainudheen
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!