At 05:27 PM 1/17/00 +0100, Dominique Chaniat wrote:
>Hello
>
>I am working under Win98, with Jswdk 1.0
>
>I want try the followed communication
>
> servlet
> | |
> V V
> bean <-JSP
>
>My servlet calls the bean, and the Jsp file
>I want initialize from my servlet a value into my bean, then read this
>value from my Jsp.
>
>When I try to read this value from my Jsp, I get 0.
>
>Do you have an experience about it.
Hi,
The only thing your missing is you need to stick the bean object in the
HttpSession.
Add something like:
HttpSession session = request.getSession(true); // true = create session if
its not already created.
session.putValue("MyBean", mybean);
where MyBean is the name your JSP page uses in the <jsp:useBean
id="MyBean"...> and mybean is the bean object you created.
Keep in mind, when you do this, your bean is now a SESSION object. You need
to use the scope="session" in your useBean tag.
Kevin Duffey
Software Engineer
[EMAIL PROTECTED]
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html