| | |
Session variables
Please support our JSP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
You will have to cast it to the reference type you are expecting it to return. This is because the specifications say that getAttribute() returns a variable of type Object which of course makes sense since it enables us to store a reference variable of any kind. Maybe something along the lines of:
JSP Syntax (Toggle Plain Text)
session.setAttribute("isLoggedIn", Boolean.TRUE); Boolean b = (Boolean)session.getAttribute("isLoggedIn");
I don't accept change; I don't deserve to live.
If you find a solution to a problem, it is recommended that you mark it as solved by clicking the Mark it as solved link, and if possible, posting the solution which worked for you. That way, someone else facing the problem who stumbles upon this thread might find your answer to be useful. I guess this is the least we all can do, can't we? :-)
I don't accept change; I don't deserve to live.
![]() |
Similar Threads
- Session variables not carrying over to next page (PHP)
- Session variables (ASP.NET)
- PHP Session Variables (PHP)
- Session Variables a threat? (VB.NET)
Other Threads in the JSP Forum
- Previous Thread: Using md5 in JSP
- Next Thread: Displaying language other than English on JSP
| Thread Tools | Search this Thread |
apache array backbutton combobox comma connection csv database development directorystructure dropdownlist dynamicpagetitles eclipse frames glassfish ie8 imagetodatabse imageupload integer internet java javaee javascript jsf jsp jsppagetitles levels mvc2 mvcmodel2 mysql netbeans network parameters passing ping printinserverinsteadofclient read redirect request.getparameter response seperated servlet servletdopost()readxml sessions software sql ssl state_saving_method stocks sun tomcat tutorial update values video web write






