tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Greg Trasuk" <stratus...@on.aibn.com>
Subject RE: Servlet/Jsp
Date Wed, 22 May 2002 14:10:35 GMT
Looks like you're asking the JSP to look for the bean in the session rather
than the request.  Try changing
	<jsp:useBean id="bean"  class="MyBean" scope="session"/>
to:
	<jsp:useBean id="bean"  class="MyBean" scope="request"/>

Cheers,

Greg Trasuk, President
StratusCom Manufacturing Systems Inc. - We use information technology to
solve business problems on your plant floor.
http://stratuscom.ca

> -----Original Message-----
> From: Djaballah BOUCHEGRA [mailto:bouchegra@yahoo.fr]
> Sent: May 21, 2002 05:24
> To: tomcat-user@jakarta.apache.org
> Subject: Servlet/Jsp
>
>
> I have a servlet that sets an attribute in the request
> object containing a
> bean:
>
> ...
> MyBean bean = new MyBean();
> bean.setS("Hello");
> req.setAttribute( "mybean", bean );
> ...
>
> And that gets forwarded to my JSP page:
>
> ...
> RequestDispatcher dispatcher =
> getServletContext().getRequestDispatcher("MyPageJsp.jsp");
> dispatcher.forward(request, response);
>
> On the JSP page I unsuccessfully extract the value
> "hello" of the bean property S
>
> MyJspPage.jsp:
> <jsp:useBean id="bean"  class="MyBean" scope="session"
> />
> ....
> <%=bean.getS()%>
>
> the result is : null
>
> Do you have any idea about why my page Jsp couldn't
> access to the value of the bean property?
>
> I am using JDK 1.3 and Tomcat 3.2
>
> Thanks!
> Djaballah
>
>
> ___________________________________________________________
> Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en fran├žais !
> Yahoo! Mail : http://fr.mail.yahoo.com
>
> --
> To unsubscribe, e-mail:
> <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:tomcat-user-help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message