rainerh  committed 9a637f1

added more javadoc to indicate the behaviour when validators are available in both actionClass-validation.xml and actionClass-actionAlias-validation.xml that the nett effect will be a combination of validators defined in both validation xml file. As a user found this to be not properly defined in the docs.
o ported fix from xwork 1.2 branch


  • Participants
  • Parent commits 1a131a5
  • Branches master

Comments (0)

Files changed (1)

File src/java/com/opensymphony/xwork2/validator/

  * the Action. If you are using the short-circuit attribute and relying on
  * default validators higher up in the inheritance tree, make sure you don't
  * accidentally short-circuit things higher in the tree that you really want!</p>
+ * <p>
+ * The effect of having common validators on both
+ * </p>
+ * <ul>
+ * 	<li>&lt;actionClass&gt;-validation.xml</li>
+ *     <li>&lt;actionClass&gt;-&lt;actionAlias&gt;-validation.xml</li>
+ * </ul>
+ * <p>
+ * It should be noted that the nett effect will be validation on both the validators available
+ * in both validation configuration file. For example if we have 'requiredstring' validators defined
+ * in both validation xml file for field named 'address', we will see 2 validation error indicating that
+ * the the address cannot be empty (assuming validation failed). This is due to WebWork
+ * will merge validators found in both validation configuration files.
+ * </p>
+ * <p>
+ * The logic behind this design decision is such that we could have common validators in
+ * &lt;actionClass&gt;-validation.xml and more context specific validators to be located
+ * in &lt;actionClass&gt;-&lt;actionAlias&gt;-validation.xml
+ * </p>
  * <!-- END SNIPPET: howXworkFindsValidatorForAction -->
  * @author Jason Carreira