struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William Jaynes" <>
Subject ActionForm population question
Date Wed, 07 Mar 2001 21:20:18 GMT
As we all know, the ActionForm is automatically populated from any appropriatly named request
parameters.  I'm wondering why it isn't populated from the request parameters and any request
attributes, both?

The motivation for the question comes from this example: I have a person search page.

If the result of the search is more than one person I forward to a page with a drop-down box
so they
can select the desired person. This selection sends them to a result page, via a resultAction.
of the request parameters sent, from the drop-down box, is the personId.

If the result of the search is one person then I forward directly to the resultAction and
skip the
drop-down box page. But here I need to somehow get the personId to the resultAction. Setting
request attribute would be simple. As it is, what I need to do is forward to
   new ActionForward(mapping.findForward("display").getPath() + "?personId=" + person.getId())

Seems like just setting a request attribute would be easier and more intuitive.

View raw message