Dion,

The code you posted contains the following:

session.setAttribute("helloses", "hi session");
out.println("helloses prints = " +
(String)request.getAttribute("helloses"));

You are setting the attribute in the *session* and trying to retrieve it
from the *request*. That is obviously not going to work...

--
Martin Cooper
Tumbleweed Communications

----- Original Message -----
From: "dion" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 17, 2000 2:30 AM
Subject: Re: request.setAttribute vs session.setAttribute


> Hello Martin,
>
> that's what i'm trying to find out, please see again :)
> using session doesn't work, but using request work.
> thx anyway :)
>
> Friday, November 17, 2000, 12:52:46 PM, Martin Cooper wrote:
>
> MC> It might help if you try to get the "helloses" attribute from the
session
> MC> rather than the request...
>
> MC> --
> MC> Martin Cooper
> MC> Tumbleweed Communications
>
> MC> ----- Original Message -----
> MC> From: "dion" <[EMAIL PROTECTED]>
> MC> To: <[EMAIL PROTECTED]>
> MC> Sent: Thursday, November 16, 2000 6:58 PM
> MC> Subject: request.setAttribute vs session.setAttribute
>
>
> >> Hello all,
> >>
> >> i can't understand why some of jsp code below fails :
> >> the output of the code is :
> >> helloreq prints = hi request -- helloses prints = null
> >>
> >> in other words, it fails when using session implicit object.
> >> could you explain to me why that happens?
> >> btw, i can't make the newline works (like showed in output), how to
> >> make the 2nd 'hi' go to the new line?
> >>
> >> thanks a lot :)
> >>
> >> <%
> >>    request.setAttribute("helloreq", "hi request");
> >>    session.setAttribute("helloses", "hi session");
> >>
> >> out.println("helloreq prints = " +
> MC> (String)request.getAttribute("helloreq"));
> >> out.println(" -- ");
> >> out.println("helloses prints = " +
> MC> (String)request.getAttribute("helloses"));
> >>
> >> %>
> >>
> >> --
> >> Best regards,
> >>  dion                          mailto:[EMAIL PROTECTED]
>
>
> --
> Best regards,
>  dion                            mailto:[EMAIL PROTECTED]
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to