Joel Carklin wrote:
Thanks for everyones help on this...
I guess what I am wondering now is a bit different to my previous
question:
If my controller.jsp sets a request scope attribute before forwarding to
a new page (using <jsp:forward>), that attribute is available on the new
page:
ie if my controller.jsp says:
request.setAttribute("aMessageString", "This is a message");
and then forwards to a new page, I can then on the new jsp page say
<%= request.getAttribute("aMessageString") %>
and it will display my message on the screen.
This works fine.
If I set an instance of "myBean" as an attribute as in
request.setAttribute("myBean", myBean);
then I thought if I use the tag:
<jsp:useBean id="myBean" scope="request" class="package.name.myBean" />
then instead of creating a 'new' instance of myBean, it would find there
is already an attribute called myBean and would use that. Since the
myBean instance is populated with data, I could then use the
<jsp:getParameter> tag to display fields in myBean...
Yep, that's how it's supposed to work. Doesn't it? If not, tell us
what happens, which container you're using, and show us the code for
reproducing the problem.
Hans
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
JavaServer Pages http://TheJSPBook.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com