• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to use session attribute

 
Raghu ram
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello frnds,

I have customerlogin page (has username and password) and that linked to customerservice page and this one linked to change profile page(contains change password, change name, change phone no.) So using session attribute how to set that username so that in change profile page i want to get that username.
Reply soon
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

[ January 11, 2008: Message edited by: Bear Bibeault ]
 
Raghu ram
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So How to send it to the browser
 
Raghu ram
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so that username has to get in the changeprofile browser.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "send it to the browser"? Session attributes exist (and are used) on the server.
 
Raghu ram
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


from this code we will get username attribute. So to use this attribute in another servlet what should i do.
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Raghu ram:


from this code we will get username attribute. So to use this attribute in another servlet what should i do.


Nothing much. Once you say, setAttribute, it sets the attribute in the particular session on the Server.

In any other servlet or jsp, you can get access to the session first and then from the session, you can get the attribute by making use of "getAttribute()".
 
Raghu ram
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the reply
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic