You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Musachy Barroso (JIRA)" <ji...@apache.org> on 2007/05/08 14:47:42 UTC

[jira] Commented: (WW-1897) Create JSONValidationInterceptor

    [ https://issues.apache.org/struts/browse/WW-1897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40945 ] 

Musachy Barroso commented on WW-1897:
-------------------------------------

Email from dev mailing list:

Just to follow up on this, everything is in trunk. This is how it works:

Actions with the "jsonValidation" interceptor applied, will return something
like:

/* {
       "errors": ["Action error"],
       "fieldErrors": {
          "name": ["Name is required", "Something else"]
       }
   } */

if validation fails. If validation succeeds, action will return regular
output. If the there is a request parameter, "validateOnly" the action won't
be executed, even if validation succeeds, in which case this will be
returned:

/* {} */

The interceptor has a "validationFailedStatus" which will be used as the
request status, if validation fails (not used by default).

The submit, anchor, and bind tags have a new attribute "ajaxAfterValidation"
(false by default), which if set to true, an ajax request will be made, if
validation succeeds. So now if you are using the ajaxtags to make ajax
requests, ajax validation can be used by setting this attribute to true.

The ajax validation example in showcase is updated with 2 examples, one
using regular submit after validation and another using ajax request after
validation. Feedback is appreciated :)

> Create JSONValidationInterceptor
> --------------------------------
>
>                 Key: WW-1897
>                 URL: https://issues.apache.org/struts/browse/WW-1897
>             Project: Struts 2
>          Issue Type: Improvement
>            Reporter: Musachy Barroso
>         Assigned To: Musachy Barroso
>             Fix For: 2.1.0
>
>
> * Fix ajax tags to use the JSON generated by this interceptor to perform ajax validation
> * Fix showcase example

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