Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

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!

I'm getting a null in a session variable

843835Dec 9 2002 — edited Dec 26 2002
I'm getting a null value when I want to session.getAttribute("admin_capview")

The problem is that in my Development PC (Dell, WinXP) works fine, but when I run this JSP in my Production Server (HP, Win2000) from my Dell-PC it doesn't work. But wait there's more, When I run this same JSP IN my Production Server it works FINE. What's wrong with this thing?!?, I have the same version of Java and Forte in both servers. Any clue????

I've read and tried almost all the suggestions in this Forum, all of them behave in the same way. HELP

JSP1: Creation of my session
synchronized(session) {
if (el_nombre.compareTo("admin")==0) {
String valor = "1";
session.setAttribute("admin_capview", valor);
}
else{
String valor = "0";
session.setAttribute("admin_capview", valor);
}
}

JPS2: Validation of my session

request.getSession(true);
String obj_getsession = (String) session.getAttribute("admin_capview");
//Old fashion Debugger
System.out.println("USUARIO str: "+ obj_getsession);
// From Dell, I receive a null
// From any other, I receive a String
// In the HP, I recieve a String
// From Dell in my Dell, I receive a String

if ( obj_getsession.compareTo("0")==0 )
//code
else
//code
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 23 2003
Added on Dec 9 2002
11 comments
1,292 views