struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Husted <hus...@apache.org>
Subject Re: ActionForm initialization
Date Tue, 02 Jul 2002 17:54:07 GMT
If the scope object uses the same protocol (method names) as the
ActionForm, then it can be passed to the view directly. The tags all
work through reflection. All they care about is that the method names
match. So you can populate the form with one class, but submit it to an
Action that uses an ActionForm class to capture the input. 

If a JavaBean with the appropriate attribute name is not already in
scope, then the html:form will create one. This must be an ActionForm
type. But if the bean already exists, it will use whatever is there to
populate the form. 

-- Ted Husted, Husted dot Com, Fairport NY US
-- Java Web Development with Struts
-- Tel: +1 585 737-3463
-- Web: http://husted.com/about/services

struts-dev@japache.org wrote:
> 
> Thank you for your thorough response.
> 
> Point of clarification: I'm talking about having the data available to some form found
in the view being forwarded to. This is not the form being passed *to* the action. In other
words, the Action sees the query data from the URL that got us to the action. That's great.
But the Action does not really know details about where the is forwarded to.
> 
> I just want a convenient way for the ActionForm within the view to be able to reference
the scope object directly. Again, this would lead to less duplicate code. The fact that so
many people have to resort to "PropertyUtils.copyProperties" to copy data shows that this
is a common situation.
> --
> Posted via jApache.org
> 
> --
> To unsubscribe, e-mail:   <mailto:struts-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:struts-dev-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:struts-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-dev-help@jakarta.apache.org>


Mime
View raw message