Ajax Validation does not work with ModelDriven Actions
------------------------------------------------------

                 Key: WW-2721
                 URL: https://issues.apache.org/struts/browse/WW-2721
             Project: Struts 2
          Issue Type: Bug
          Components: Core Interceptors
    Affects Versions: 2.1.2
            Reporter: Wolfgang Schröder


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());


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to