struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 19802] New: - Configurable processPopulate()
Date Fri, 09 May 2003 15:47:39 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19802>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19802

Configurable processPopulate()

           Summary: Configurable processPopulate()
           Product: Struts
           Version: 1.1 RC1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Controller
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: carlhope@hopcourt.com


This has come up before (http://nagoya.apache.org/eyebrowse/ReadMsg?
listName=struts-user@jakarta.apache.org&msgId=149281), but is close to a bug 
and I request that it be considered for a future fix (should be easy).

REQUEST

The request is that an additional param be added to the ActionMapping to 
specify if reset/populate should be invoked, very much like the existing 
validate param is used. 

 
RATIONALE  

When the ActionMapping configuration specifies both an ActionForm and an 
Action, then the RequestProcessor always calls reset() on the ActionForm and 
then populates it from the request params.  This is ideal for an 
ActionForm/Action combo that is processing input from an HTML form.  However, 
when an Action is called to populate an ActionForm prior to displaying the 
HTML form, it is incorrect.   Attributes of the ActionForm may be populated 
from the request even though the request does not relate to the current form.  
At best this is unnecessary processing, at worst it leads to bugs when there 
are accidental matches between request param names and ActionForm methods 
(which is how I found this).


Using separate actions for setting up output and processing input does not 
solve this problem unless the "output" ActionMapping does not specify a form. 
Since the purpose of the Action is to populate the ActionForm, this is 
undesirable.  It is possible to omit the form name from the ActionMapping and 
then explicitly retrieve the appropriate ActionForm using code in the Action, 
but this defeats the purpose of using a config definition.  There are other 
workarounds that are "klugey" but the best solution is to add the 
ActionMapping parameter.

Thanks for considering this. 

Carl Hope

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


Mime
View raw message