I am not sure if the code you have given is from the first servlet that the app hits, and if the index.jsp is the first page that is displayed. Anyway JSPs participate in session by default and if you have not created a session before index.jsp then the container will create a session id which will be replaced once you create a session in the servlet. I am not sure of the order in which your jsps and servlets are called. Depending on this order you may have the scenario which i just described. Hope this helps
-----Original Message----- From: Rajesh Kumar Ilango, Gurgaon [mailto:[EMAIL PROTECTED]] Sent: 02 September 2002 11:02 To: JDJList Subject: [jdjlist] RequestDispatcher.forward method creating a new Session. Hi, I am using Tomcat 4.0. I have the following code in a Servlet session.setAttribute("USER", szLoginName); session.setAttribute("APPLICATION", new Integer(appID)); RequestDispatcher rd = getServletContext().getRequestDispatcher("index.jsp"); rd.forward(request,response); In the index.jsp I was not able to access the "USER" and "APPLICATION" attributes that I am setting in session object. Moreover session.getId() on both the page and the servlet reveals different session ID. Does any body has any idea why this is happening? Similar forwards from JSP to JSP is working absolutly fine. Rdgs. _____________________________________________________________________ Rajesh Kumar Ilango To change your JDJList options, please visit: http://www.sys-con.com/java/list.cfm To change your JDJList options, please visit: http://www.sys-con.com/java/list.cfm
