How to Access Session Variables in Servlets & JSp

Showing Answers 1 - 1 of 1 Answers

Manikant

  • May 25th, 2006
 

Use can store variables in session, but u can store it in object form only.if it is primitive type u can use wrapper classes to convert it into object.

session.setAttribute("test","xyzp");

String str=(String)session.getAttribute("test");

while retrieving data u need to cast it back to its original type.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions