struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vladimir Limansky (JIRA)" <j...@apache.org>
Subject [jira] Created: (WW-3035) JSONValidationInterceptor builds incorrect responce if only action errors are enabled
Date Thu, 12 Mar 2009 18:03:02 GMT
JSONValidationInterceptor builds incorrect responce if only action errors are enabled
-------------------------------------------------------------------------------------

                 Key: WW-3035
                 URL: https://issues.apache.org/struts/browse/WW-3035
             Project: Struts 2
          Issue Type: Bug
          Components: Core Interceptors
    Affects Versions: 2.1.0
         Environment: struts2-core-2.1.0.jar struts2-dojo-plugin-2.1.0.jar
            Reporter: Vladimir Limansky


1. Let's take a look at org.apache.struts2.interceptor.validation.JSONValidationInterceptor
buildResponce method
instead of 
            if (validationAware.hasActionErrors()) {
                sb.append("\"errors\":");
                sb.append(buildArray(validationAware.getActionErrors()));
                sb.append(",");
            }
should be 
            if (validationAware.hasActionErrors()) {
                sb.append("\"errors\":");
                sb.append(buildArray(validationAware.getActionErrors()));
                if (validationAware.hasFieldErrors()) {
                	sb.append(",");
                }
            }
Because if there are no field errors, but only action errors, incorrect JSON object is built.


2. This issue relates to https://issues.apache.org/struts/browse/WW-2609.
I want to make a fix for my local project, but I'm not sure what is the best place to display
action errors. Personally, displaying actions errors just above the form submitted is not
the best place. Probably it would be better to extend actionerror.ftl by adding a label(div
element) where I can place action error messages for ajax validation. What do you think?

3. I want to submit some fixes into the struts project. How I can obtain the permissions to
participate?


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


Mime
View raw message