This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
hi all can anybody clarify me the difference between using HTTPSession session.setAttribute("",""), and request.getSession().setAttribute("",""); 1. How the scope of these two session object are different? thanks in advance Vikas
By saying that "Both are same provided the session has not already timed out." Do we mean if session times out , we get different types of exception depending upon the classes(HTTPSession and Request) of session object?
request.getSession() returns a session if one exists or creates a new one if it does not. It is the same as calling request.getSession(true). Since retrieving a session goes like this: HttpSession session = request.getSession(); or: HttpSession session = request.getSession(true); Then: HttpSession session = request.getSession(); session.setAttribute(Object a, Object b); would have to be the same as: request.getSession().setAttribute(Object a, Object b); or: request.getSession(true).setAttribute(Object a, Object b);
No more rhymes! I mean it!<br /> <br />Does anybody want a peanut?