struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Musachy Barroso (JIRA)" <j...@apache.org>
Subject [jira] Commented: (WW-1897) Create JSONValidationInterceptor
Date Tue, 08 May 2007 12:47:42 GMT

    [ 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.


Mime
View raw message