Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Duplicate
-
2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.1.5, 2.1.6
-
None
-
None
Description
Validation fails when empty message is defined @VisitorFieldValidator(message=""), stack:
java.lang.NullPointerException
at com.opensymphony.xwork2.util.TextParseUtil.translateVariables(TextParseUtil.java:155)
at com.opensymphony.xwork2.util.TextParseUtil.translateVariables(TextParseUtil.java:116)
at com.opensymphony.xwork2.util.TextParseUtil.translateVariables(TextParseUtil.java:38)
at com.opensymphony.xwork2.validator.validators.ValidatorSupport.getMessage(ValidatorSupport.java:99)
at com.opensymphony.xwork2.validator.validators.VisitorFieldValidator.validateObject(VisitorFieldValidator.java:156)
at com.opensymphony.xwork2.validator.validators.VisitorFieldValidator.validate(VisitorFieldValidator.java:130)
..
Broken both on annotation and XML validators. Empty messages worked 2.0 but not in 2.1 (Tested up to 2.1.6).
This is annoying on ModelDriven actions, since you can't delegate validations to model object. (empty message crashes validation and non-empty message will be appended to the actual messages of models validators).