Rick Reumann wrote:

This is another reason why I still think calling validate() manually from your Action is a much better approach then relying on Struts do it for you. If you call form.validate() from your Action you then have control over what you want to do. So in your Action you could do...

//in your Action execute or dispatch method:

ActionErrors errors = myForm.validate();
if ( errors != null ) {
mySpecificMethod();
return( mapping.findFoward("SUCCESS");
} else {
saveErrors(request, errors);
return( mapping.findFoward("SUCCESS");
}


On this note, but slightly different, I use something very similar to this within all DispatchActions. My reasoning is that you can only configure one input attribute for an Action. DispatchActions obviously open up the possibility for several inputs. This is something that the current configuration doesn't handle very well, IMO.

In particular, I think it would be interesting to see a configuration for DispatchActions like so:

<DispatchedAction path="/MyDispatch"
                          parameter="method"
                           .../>
            <Action name="create"
                         form="foo"
                         input="create.jsp">
                     <mapping .../>
              </Action>

            <Action name="edit"
                         form="foo"
                         input="edit.jsp">
                     <mapping .../>
              </Action>

            <mapping .../>

</DispatchedAction>

Obviously you can achieve very similar results by simply creating multiple Actions, but perhaps a configuration like this would allow for some inheritence (as in, define attributes for the DispatchedAction and optionally override them for nested actions, share/override mappings within the Dispatch's scope).

Thoughts?  Has this already been mentioned?


- Dave

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to