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"/>

In the running the JSP doesn't use the instance created in the servlet
but it cretes a new istance.
If in the JSP I read the bean as a generical object
<% UserBean userBean = (UserBean)request.getAttribute("userBean"); %>
it work fine.

I'd like to be able to use the bean. How can I do?
Tanks in advance
Alessandra

===========================================================================
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

Reply via email to