[ http://issues.apache.org/struts/browse/STR-2314?page=comments#action_38049 ] Michael Jouravlev commented on STR-2314: ----------------------------------------
It is possible to use several HTML forms on a page, each tied to a separate action mapping and to a separate ActionForm. In this regard, current approach used in Struts is not perfect. If you can think of something that advertises ActionForm as an attribute, while allowing having sevaral html forms and accessing their respective ActionForms' attributes from any part of a page, that would be interesting. > Make ActionForm accessible via request attribute for *each* request > ------------------------------------------------------------------- > > Key: STR-2314 > URL: http://issues.apache.org/struts/browse/STR-2314 > Project: Struts 1 > Issue Type: Improvement > Components: Core > Affects Versions: 1.2.6 Beta > Environment: Operating System: All > Platform: PC > Reporter: Matthew Sgarlata > Assigned To: Struts Developers > Priority: Minor > > What would the Struts committers think of advertising the ActionForm at a set > request attribute key for *each* request? This would allow other frameworks > and > toolkits easier access to the Struts ActionForm. (I have a specific use case > in > mind, if you'd like more info). It would also dramatically simplify the code > in > FormTag.initFormBean, which ends up having to work backwards to determine > where > the ActionForm is after-the-fact, and eventually stores the ActionForm in a > set > request attribute anyway (Constants.BEAN_KEY). > Changes I propose (and I will submit patches if someone will commit them!): > - Add code to the RequestProcessor.processActionForm method that causes it to > store a reference to the form in request scope at Constants.BEAN_KEY. > (Existing > code which stores the ActionForm at the request or session attribute > configured > through the ActionMapping will remain unchanged). > - Simplify FormTag.initFormBean to simply read the form bean from the request, > rather than working backwards to figure it out. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
