CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Equivalent getSession() for JSP

Print topic Send  topic

Author Message
gianni
Posted: 06/14/2002, 1:38 AM

Hi,
In PHP we have get_session($param_name).
What's the corresponding in JSP?

Thank you
Gianni
Alex Alexapolsky
Posted: 06/14/2002, 2:17 AM

Like this
(String) session.getAttribute(variable)
Alex Alexapolsky
Posted: 06/14/2002, 2:17 AM

See java docs on session object.
It's like this
session.getAttribute("name")
Gianni
Posted: 06/14/2002, 2:56 AM

Ok, I've read the Sun's Javadoc for getAttribute and now I have this question:
session.getAttribute("UserRights") returns a java.lang.Object... but how do I handle it? If I compare

if (session.getAttribute("UserRights") < 3) .....

I inevitably get the error:
Incompatible type for <. Can't convert java.lang.Object to int.


http://java.sun.com/products/servlet/2.2/javadoc/javax/...ttpSession.html


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.