Session is lost when going from a servlet to a jsp - Weblogic

This is a discussion on Session is lost when going from a servlet to a jsp - Weblogic ; Any help would be greatly appreciated. I can sucessfully go from my jsp page to the Servlet. When in the servlet I have a service method where I place the information from my form on the jsp on a bean. ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Session is lost when going from a servlet to a jsp

  1. Session is lost when going from a servlet to a jsp

    Any help would be greatly appreciated.

    I can sucessfully go from my jsp page to the Servlet. When in the servlet I have a service method where I place the information from my form on the jsp on a bean. Then I do a session.setAttribute("aBean", aBean) to place the bean in the session. Then do a req.sendRedirect("my.jsp"). Watching it in the debugger, when we leave the servlet our session is cleared and when we do a jsp:usebean to get the bean session from the session it creates a new bean so all the information is gone that was there before. here is my usebean tag where we are getting it from scope,


    Thanks, Trucker

  2. Re: Session is lost when going from a servlet to a jsp

    If you have the code :

    HttpSession session = request.getSession(true);

    before the redirect :

    request.sendRedirect("my.jsp");

    that's the source of the problem. You're creating
    a new session.

    Change true to false.


+ Reply to Thread