Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1.2
-
None
Description
The JSON-Object returned by interceptor org.apache.struts2.interceptor.validation.JSONValidationInterceptor returns the fieldnames of failed validation-elements with the prefix 'model.' but the JS-Scripts (/struts/utils.js, /struts/xhtml/validation.js, /struts/css/validation.js) do not "know" about the ModelDriven-Concept. As a consequence, the ajax-validation worked correctly but the JS-Script do an alert "Can't validate myform_password". So it's either the intercptor or the scripts which have a bug.
Imho the interceptor should be fixed. My workaround was this:
Line 169:
if(validationAware instanceof ModelDriven)
sb.append(fieldError.getKey().substring(6));
else
sb.append(fieldError.getKey());