Because when you retrieve the request, the request is over. The object is
gone.
Set those values at the session level.
--
-Geoff Marshall, Director of Development
.......................................................
t e r r a s c o p e (415) 951-4944
54 Mint Street, Suite 110 direct (415) 625-0349
San Francisco, CA 94103 fax (415) 625-0306
.......................................................
> From: "Santosh Kumar" <[EMAIL PROTECTED]>
> Reply-To: Orion-Interest <[EMAIL PROTECTED]>
> Date: Fri, 2 Mar 2001 14:06:46 +0530
> To: Orion-Interest <[EMAIL PROTECTED]>
> Subject: Storing HttpServletRequest Object in Session
>
> Hi all,
> I tried to store the implicit request object in session. But when i tried to
> retrieve it.
>
>
> one.jsp
> ----------
>
> ...
> ...
>
> request.setAttribute("ONE", "1");
> request.setAttribute("TWO", "2");
> ..
> ..
> session.setAttribute("request",request);
> ..
> --> forward to two.jsp
>
>
> two.jsp
> ----------
> request = (HttpServletRequest) session.getAttribute("request");
> out.println((String) request.getAttribute("ONE"));
> out.println((String) request.getAttribute("TWO"));
>
>
> Both the print statements are returning null.. i was expecting 1 and 2
> WHY????
>
>
> Regards,
> Santosh
>
>
>
>
>
>