Try using :

                session.putAttribute("USER", szLoginName);
                session.putAttribute("APPLICATION", new Integer(appID));

Regards,

Fintan

> -----Original Message-----
> From: Rajesh Kumar Ilango, Gurgaon [SMTP:[EMAIL PROTECTED]]
> Sent: 02 September 2002 10: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


* ** *** ** * ** *** ** * ** *** ** *
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. 
Any views or opinions presented are solely those of the author, and do not necessarily
represent those of ESB. 
If you have received this email in error please notify the sender.

Although ESB scans e-mail and attachments for viruses, it does not guarantee
that either are virus-free and accepts no liability for any damage sustained
as a result of viruses.

* ** *** ** * ** *** ** * ** *** ** *

To change your JDJList options, please visit: http://www.sys-con.com/java/list.cfm

Reply via email to