struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Benedict (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (STR-1116) ActionForm reset strategy
Date Wed, 07 Nov 2007 06:23:34 GMT

     [ https://issues.apache.org/struts/browse/STR-1116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Paul Benedict resolved STR-1116.
--------------------------------

    Resolution: Fixed
      Assignee: Paul Benedict  (was: Michael Jouravlev)

Updated to distinguish between a forward, include, and chained request.

> ActionForm reset strategy
> -------------------------
>
>                 Key: STR-1116
>                 URL: https://issues.apache.org/struts/browse/STR-1116
>             Project: Struts 1
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: Nightly Build
>         Environment: Operating System: All
> Platform: All
>            Reporter: Jan Cumps
>            Assignee: Paul Benedict
>            Priority: Minor
>             Fix For: 1.4.0
>
>
> New attribute in <action> element where you can flag if you want the framework

> to call the reset() function of the ActionForm .
> It's very much like the "validate" attribute already present.
> This attribute would default to "true" for backward compatibility.
> Rationale:
> If you use checkboxes, you need to set the corresponding ActionForm property 
> to "false" before the bean is populated from the request attributes (in the 
> reset() method).
> But when you chain actions , you don't want this to happen (you would loose 
> information).You want your bean to keep the info.
> Example:
> traceopen calls tracedetail on success -> show tracedetail.jsp
> tracesave calls tracedetail when validation fails (input attribute) -> show 
> tracedetail.jsp
> tracedetail does some common things always needed for tracedetail.jsp (eg.load 
> values for <select> tag from model). 
> It should receive the ActionForm in the state it was in the calling action.
>     <!-- Process a trace open for a new or existing trace -->
>     <action    path="/trace/traceopen"
>                type="org.blabla.TraceOpenAction"
>                name="traceForm"
>                scope="request"
>                reset="true">
>       <forward name="success"              path="/trace/tracedetail.do"/>
>       <forward name="failure"              path="/index.jsp"/>
>     </action>
>     
>     <!-- prepare tracedetail.jsp resources -->
>     <action    path="/trace/tracedetail"
>                type="org.blabla.TraceDetailAction"
>                name="traceForm"
>                scope="request"
>                reset="false">
>       <forward name="success"              path="/trace/tracedetail.jsp"/>
>       <forward name="failure"              path="/index.jsp"/>
>     </action>
>  
>     <!-- Process a trace save -->
>     <action    path="/trace/tracesave"
>                type="org.blabla.TraceSaveAction"
>                name="traceForm"
>                scope="request"
>                reset="true">
>                input="/trace/tracedetail.do">
>       <forward name="success"              path="/trace/tracelist.do"/>
>       <forward name="cancel"               path="/trace/tracelist.do"/>
>     </action>
> note:
> Can all be done by overriding ActionConfig.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message