2 Replies Latest reply on Jan 12, 2005 5:24 PM by John Kenny

    lost session attributes

    John Kenny Newbie

      Here is my problem. I have a JSP page which has access to the implicit object pageContext.
      When I get the session out of the pageContext and print the enumeration of its attributes everything works as expected and my 10 attributes are listed.

      Then my JSP page calls a taglib, which creates a RequestDispatcher (which points to another JSP page), I use the include method of the RequestDispatcher to include the "sub" JSP page.

      From the included JSP page I call another taglib which access pageContext but when I get the session out of the pageContext the Id and time of creation match my previous session but when I print out the enumeration of the session attributes there are none.

      Has anybody run into session problems in included JSP pages?

        • 1. Re: lost session attributes
          Wiley Snyder Newbie

          Have you tried just response redirect instead of the dispatcher? I had some simliliar issues when I tried to keep two applications talking to each other on the same session ...

          • 2. Re: lost session attributes
            John Kenny Newbie

            What I found is that when I include a JSP from another war file I am apprently getting another session. The session ID I get from the top level JSP is the same as the session ID from the included JSP from the other war but the creation time and the attributes are different.

            The only way I can get at my primary session from the original war file is to add it as a request attribute before I include the JSP from the other war file. Then in the included JSP I get the primary session I want out of the request instead of the actual session associated with the included JSP.