struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Reumann <strut...@reumann.net>
Subject Re: Need to pass data to JSP in ActionForm
Date Wed, 04 Feb 2004 04:25:54 GMT
Pat Young wrote:

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

Personally I often opt for the easy solution and put the List in Session 
scope, but there are other alternatives that have been discussed on this 
list before.

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

Depends what you mean by "build beans." Nothing wrong wtih setting stuff 
into Request scope from your Actions, but make sure you are calling some 
business process that does the actual "building." For example...

//in your Action:
List someList = someBusinessClass.getMyList();
request.setAttribute("listWhatever", someList);

-- 
Rick

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message