Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Session Object  RSS feed

 
krish chaitu
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Iam new to java, so i have one more requirement where i need to display the user information that is stored in a session object in the previous page in this page ,

how can i do it.please help me.

Thanks
krish
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More information please.
Every basic JSP book or example shows how to do this basic operation.

Where are you stuck? What have you done so far?
 
Varun Narang
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Krish,
You might want to read more about Session Objects in Java-Servlet, as they store the information on the session basis and not on the per-page basis.

HttpSession

Regards,
VaruNarang.
[ October 18, 2007: Message edited by: Varun Narang ]
 
Gayathri Chowduru
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Krish,

You already stored your previous page values in session object. so, in your current jsp page, you write like (I am giving you a sample code)


So, whatever the data type is, you can code like this, but don't forget to type cast your session Object value to your required data type.

[BPSouther: Added code tags]
[ October 23, 2007: Message edited by: Ben Souther ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!