Anonymous avatar Anonymous committed fbe1fd5

XW-643 validation annotation message attribute required even if using key attribute

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@1834 e221344d-f017-0410-9bd5-d282ab1896d7

Comments (0)

Files changed (16)

src/java/com/opensymphony/xwork2/validator/ValidatorConfig.java

         }
 
         public Builder defaultMessage(String msg) {
-            target.defaultMessage = msg;
+            if ((msg != null) && (msg.trim().length() > 0)) {
+                target.defaultMessage = msg;
+            }
             return this;
         }
 

src/java/com/opensymphony/xwork2/validator/annotations/ConditionalVisitorFieldValidator.java

 
     /**
      * The default error message for this validator.
+     * NOTE: It is required to set a message, if you are not using the message key for 18n lookup!
      */
-    String message();
+    String message() default "";
 
     /**
      * The message key to lookup for i18n.

src/java/com/opensymphony/xwork2/validator/annotations/ConversionErrorFieldValidator.java

 
     /**
      * The default error message for this validator.
+     * NOTE: It is required to set a message, if you are not using the message key for 18n lookup!
      */
-    String message();
+    String message() default "";
 
     /**
      * The message key to lookup for i18n.

src/java/com/opensymphony/xwork2/validator/annotations/CustomValidator.java

      */
     String fieldName() default "";
 
+    /**
+     * The default error message for this validator.
+     * NOTE: It is required to set a message, if you are not using the message key for 18n lookup!
+     */
     String message() default "";
 
     String key() default "";

src/java/com/opensymphony/xwork2/validator/annotations/DateRangeFieldValidator.java

 
     /**
      * The default error message for this validator.
+     * NOTE: It is required to set a message, if you are not using the message key for 18n lookup!
      */
-    String message();
+    String message() default "";
 
     /**
      * The message key to lookup for i18n.

src/java/com/opensymphony/xwork2/validator/annotations/DoubleRangeFieldValidator.java

 
     /**
      * The default error message for this validator.
+     * NOTE: It is required to set a message, if you are not using the message key for 18n lookup!
      */
-    String message();
+    String message() default "";
 
     /**
      * The message key to lookup for i18n.

src/java/com/opensymphony/xwork2/validator/annotations/EmailValidator.java

 
     /**
      * The default error message for this validator.
+     * NOTE: It is required to set a message, if you are not using the message key for 18n lookup!
      */
-    String message();
+    String message() default "";
 
     /**
      * The message key to lookup for i18n.

src/java/com/opensymphony/xwork2/validator/annotations/ExpressionValidator.java

     String expression();
 
     /**
-     * The default error messages for this validator.
+     * The default error message for this validator.
+     * NOTE: It is required to set a message, if you are not using the message key for 18n lookup!
      */
-    String message();
+    String message() default "";
 
     /**
      * The message key to lookup for i18n.

src/java/com/opensymphony/xwork2/validator/annotations/FieldExpressionValidator.java

 
     /**
      * The default error message for this validator.
+     * NOTE: It is required to set a message, if you are not using the message key for 18n lookup!
      */
-    String message();
+    String message() default "";
 
     /**
      * The message key to lookup for i18n.

src/java/com/opensymphony/xwork2/validator/annotations/IntRangeFieldValidator.java

 
     /**
      * The default error message for this validator.
+     * NOTE: It is required to set a message, if you are not using the message key for 18n lookup!
      */
-    String message();
+    String message() default "";
 
     /**
      * The message key to lookup for i18n.

src/java/com/opensymphony/xwork2/validator/annotations/RegexFieldValidator.java

 
     /**
      * The default error message for this validator.
+     * NOTE: It is required to set a message, if you are not using the message key for 18n lookup!
      */
-    String message();
+    String message() default "";
 
     /**
      * The message key to lookup for i18n.

src/java/com/opensymphony/xwork2/validator/annotations/RequiredFieldValidator.java

 
     /**
      * The default error message for this validator.
+     * NOTE: It is required to set a message, if you are not using the message key for 18n lookup!
      */
-    String message();
+    String message() default "";
 
     /**
      * The message key to lookup for i18n.

src/java/com/opensymphony/xwork2/validator/annotations/RequiredStringValidator.java

 
     /**
      * The default error message for this validator.
+     * NOTE: It is required to set a message, if you are not using the message key for 18n lookup!
      */
-    String message();
+    String message() default "";
 
     /**
      * The message key to lookup for i18n.

src/java/com/opensymphony/xwork2/validator/annotations/StringLengthFieldValidator.java

 
     /**
      * The default error message for this validator.
+     * NOTE: It is required to set a message, if you are not using the message key for 18n lookup!
      */
-    String message();
+    String message() default "";
 
     /**
      * The message key to lookup for i18n.

src/java/com/opensymphony/xwork2/validator/annotations/UrlValidator.java

 @Retention(RetentionPolicy.RUNTIME)
 public @interface UrlValidator {
 
-   /**
+    /**
      * The default error message for this validator.
+     * NOTE: It is required to set a message, if you are not using the message key for 18n lookup!
      */
-    String message();
+    String message() default "";
 
     /**
      * The message key to lookup for i18n.

src/java/com/opensymphony/xwork2/validator/annotations/VisitorFieldValidator.java

 
     /**
      * The default error message for this validator.
+     * NOTE: It is required to set a message, if you are not using the message key for 18n lookup!
      */
-    String message();
+    String message() default "";
 
     /**
      * The message key to lookup for i18n.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.