>I can't pass a bean from a servlet to a JSP.
>
>In the servlet I create an istance of "UserBean" and I pass it to a JSP
>whit this istruction:
>request.setAttribute("userBean",userBean);
>
>Then I call the JSP:
>JRunServletRequest jrunReq = (JRunServletRequest)req;
> JRunServletResponse jrunRes = (JRunServletResponse)res;
> jrunRes.callPage("page.jsp10", jrunReq);
>
>In the JSP I read the bean in this way:
><jsp:useBean id="userBean" class="UserBean" scope="page"/>
Alessandra,
Since your servlet stores the bean as an attribute of the request,
you need to use scope="request" in your tag:useBean tag. When
scope="page", the JSP engine looks for the bean in the PageContext
object.
- Mark A. Kolb Staff Engineer
[EMAIL PROTECTED] Tivoli Systems Inc.
http://www.cross-site.com (512) 436-1955
===========================================================================
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