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
|
|
|
 |
|