Daniel Henry wrote:
Dave Newton wrote:
--- Daniel Henry <[EMAIL PROTECTED]> wrote:
I would like to allow my forms to load once before
being validated.  That is the form should only be validated upon
submission, not on load. The way that I'm accomplishing this right now is by
creating a separate action to load the form, however this is starting to
clutter up the struts.xml file as the number of forms on my site
grows.   Is there any other way?

I'm assuming S2 since you say struts.xml.

The "input" result (among a few others) are
pre-configured to not be validated (see the validation
interceptor docs).
Thank you Dave.

I am using s2. However, I'm not sure how to implement this solution. The validation interceptor runs before my Action, therefore I don't have a chance to return "input."

-Dan Henry

The validation interceptor fires based on what you request, not based on what you return. The technique Dave's referring to is to create an action mapping with method='input' and a corresponding input() method in the action. You then load your form with a URL of the form ...action!input.action. The interceptor knows not to validate a request that's routed to the 'input' method, so your form loads without validation. You then submit it to the action's normal execute() method (or some other method besides input) and validation occurs.

HTH,

L.


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

Reply via email to