Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

object to string

Status
Not open for further replies.

hksr

MIS
Sep 26, 2003
30
HK
In the jsp A, I would like to pass a string to jsp B using the session method. In the jsp B, the variable to receive the string is in "object" type. How can I convert the object to string?

Thanks

tony
 
have you attempted the toString() method?

_____________________________________________________________________
onpnt2.gif

Hakuna matata!!
 
When using session objects type casting is the best way to do it.

So to get a string out you would go

String strTesting = (String)session.getAttribute("myString");

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top