Details
Description
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.