struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pat Young <>
Subject Need to pass data to JSP in ActionForm
Date Wed, 04 Feb 2004 04:11:36 GMT
I have the follow scenerio that I am trying to code

1.  I have a JSP with a form.  This page ios called
2.  The form has a select box in it that displays a
list of products.  The page grabs the products list
Bean from the Request.  There are also additional
fields in the form.
3.  The list of products is retrieved with a call to
our service layer in the Action for the JSP page. 
This Action is called "".
4.  The submit button for the form submits the data on
the form to "".
5.  The Action has an ActionForm
associated to it called "salesForm".  This form has a
validate method for validating the input.  If the
validate fails, controls is forwarded back to the
sales.jsp page.  Therefore, sales.jsp is the "input"
property for the Action.
6.  The problem I am having is that if the ActionForm
failes validation, then the sales.jsp page gets an
error becaue it can not find the bean in the Request
for the products list.  Should I build this bean in my
validate and place it in the request at the beginning
of validate?  If validate fails, there is no other
opportunity to build the products list and get it into
the Request.
7.  I typically uses Actions to retrieves and build
beans and then add them to the request for the jsp to
access.  Is this an acceptable practice also?

Any help would be greatly appreciated.

Pat Young

Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message