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

set multiple session attribute  RSS feed

 
krunal prajapati
Greenhorn
Posts: 19
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
I am beginner for session in servlet.

can I set multiple session attribute in my servlet class
for Example.


I am maintain session with the use of loginID.

and username is for showing welcome + "username" while you login.

and rec_id is pk - for my main table.

then, am I right with this code.
 
Jesus Angeles
Ranch Hand
Posts: 2070
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
krunal prajapati wrote:hi
I am beginner for session in servlet.

can I set multiple session attribute in my servlet class
for Example.


I am maintain session with the use of loginID.

and username is for showing welcome + "username" while you login.

and rec_id is pk - for my main table.

then, am I right with this code.


Yes, you can.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!