U can use request.getSession(false); method in HttpServletRequest interface.It returns the HttpSession associated with this request or null if the request has no valid session.:isAlive() method is used to check whether the session is alive or not.:there is no method isAlive() in HttpSession interface.:request.getSession() will always return a session object( if no valid session object then it creates new Session object )
Category:Servlet Interview Questions
No comments:
Post a Comment