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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LoginStatus

Status
Not open for further replies.

scripter73

Programmer
Apr 18, 2001
421
US
Hi,

I want to set a session variable that indicates whether a login was successful. I have the following in my login page:

if (Login's Successful){


s.setAttribute("loginStatus",false);
response.sendRedirect("loginInvalid.jsp");


}
else{
s.setAttribute("loginStatus",true);
response.sendRedirect("index.jsp");
}


The problem is the setAttribute takes(java.lang.String,java.lang.Object).

How can I set a session attribute? Should I just set another string?

Thanks in advance.

scripter73



Change Your Thinking, Change Your Life.
 
The "true" and "false" you use, are of the type boolean and not Boolean. You could use this, but with String it also works fine.

sjakie

----------
Yes, the world is full of strange people.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top