Has anyone successfully used declarative exception handling with Struts? For some reason, my application always forwards to the input attribute of the action element instead of the path element of the exception element as defined in my struts configuration file. I have confirmed that the error is being generated by the validateRequired method of the Struts Validator by using <html:errors> to flush the errors on the page that I am forwarded to (login.jsp in this case). However, I am never forwarded to 'loginError.jsp'. Below is my 'struts-config.xml'. Any help would be appreciated. Thanks.

- Asad


<struts-config>
   <form-beans>
      <form-bean name="loginForm" 
type="org.apache.struts.validator.DynaValidatorForm">
        <form-property name="userName" type="java.lang.String" />
        <form-property name="userPassword" type="java.lang.String" />
      </form-bean>
   </form-beans>

   <action-mappings>
      <action path="/login" type="actions.LoginAction" name="loginForm" input="/login.jsp" 
validate="true">
        <exception key="error.login.required" path="/loginError.jsp" 
type="org.apache.struts.util.ModuleException" />
      </action>
   </action-mappings>

   <message-resources parameter="MyResources" null="false" />

   <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
          <set-property property="pathnames" value="/WEB-INF/validator-rules.xml, 
/WEB-INF/validator.xml" />
   </plug-in>
</struts-config>

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

Reply via email to