Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

convert a session object to String

807598Apr 12 2006 — edited Apr 12 2006
i want to convert a session object to a String type in JSP..

the code i am using is :

<%= session.getAttribute("empID") %>

but i want to capture the value retunred into a String variable..
i have tried doing this-->

<%! String str ; %>
<% empID= session.getAttribute("empID"); %>

but it gives an error as : cannot convert object to String type.

please give me a solution as how to capture the value a session.getAttribute returns into a string variable.
thanks in advance..
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 10 2006
Added on Apr 12 2006
6 comments
1,075 views