You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2003/01/15 15:14:37 UTC

DO NOT REPLY [Bug 16107] New: - Configure if you want to call ActionForm.reset() in element in struts-config.

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=16107>.
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=16107

Configure if you want to call ActionForm.reset() in <action> element in struts-config.

           Summary: Configure if you want to call ActionForm.reset() in
                    <action> element in struts-config.
           Product: Struts
           Version: Nightly Build
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Controller
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: j_cumps@yahoo.com


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.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>