I'm using Struts 1.1 RC1 and I can't seem to figure this one out...

Basically, when I click on a cancel button, the client-side validation
is stopped, but not the server-side.

Here's my cancel button:

<html:cancel styleClass="button" property="action">
        <bean:message key="button.cancel"/>
</html:cancel>

--> onclick="bCancel=true;" is added automagically by Struts when
rendering.

My form's action is "saveUser" which does specify validation="true"

    <action
      path="/saveUser"
      type="org.appfuse.webapp.action.UserAction"
      name="userForm"
      scope="session"
      input="editProfile"
      parameter="action"
      unknown="false"
      validate="true"
    >

Since UserAction.java is a subclass of LookupDispatchAction, I should be
able to map button.cancel to a "cancel" method, which I have done, but I
never get to it.  The Validator tries to validate the form anyway:

DEBUG [Thread-5] RequestProcessor.processActionForm(367) |  Storing
ActionForm bean instance in scope 'session' under at
tribute key 'userForm'
DEBUG [Thread-5] RequestProcessor.processPopulate(808) |  Populating
bean properties from this request
DEBUG [Thread-5] RequestProcessor.processValidate(935) |  Validating
input form properties
DEBUG [Thread-5] PropertyMessageResources.getMessage(177) |
getMessage(en_US,userForm.password)
DEBUG [Thread-5] PropertyMessageResources.loadLocale(266) |
loadLocale(en_US)
DEBUG [Thread-5] PropertyMessageResources.getMessage(177) |
getMessage(en_US,userForm.email)
DEBUG [Thread-5] PropertyMessageResources.loadLocale(266) |
loadLocale(en_US)
DEBUG [Thread-5] RequestProcessor.processValidate(967) |  Validation
failed, returning to 'editProfile'
DEBUG [Thread-5] TilesRequestProcessor.processForwardConfig(298) |
processForwardConfig(/userProfile.do, false)

Thanks,

Matt

P.S.  I've written about my upgrade from Struts 1.1b3 to Struts 1.1rc1
at http://tinyurl.com/6cp9




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

Reply via email to