GitHub user cnenning opened a pull request:

    https://github.com/apache/struts/pull/72

    New result 'JSONActionRedirectResult' in json-plugin

    Adds new result 'JSONActionRedirectResult' to json-plugin. Contains tests 
and example in showcase app. The new result type is intended to be used along 
with existing JSONValidationInterceptor. It makes it possible to do form 
validation via ajax and handle form submitting, action execution and redirect 
evaluation all in one request inside JS context.
    
    The sample Action is called `AjaxFormSubmitAction`. That example is by far 
longer that the change to json-plugin itself (not just that action class but 
other files that it requires). Here is an excerpt of it's javadoc, that shows 
what can be done with the new result:
    
    * Depends on `json-plugin`.
    * Requires `jsonValidationInterceptor` to be on stack.
    * Uses a special json redirect result type.
    * Uses http parameters `struts.enableJSONValidation=true` and 
`struts.validateOnly=false`.
    * Uses a customized theme to make sure html elements required as error 
containers are always present and easily selectable in JS.
    * Uses some custom JS code depending on jQuery to issue AJAX request and to 
render errors in html.
    * Shows visual feedback while waiting for AJAX response.
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/cnenning/struts ajax-form

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/struts/pull/72.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #72
    
----
commit cb11898416949c4028d99651e9697671797f1b99
Author: cnenning <cnenn...@apache.org>
Date:   2016-01-11T13:36:32Z

    Adds new result 'JSONActionRedirectResult' to json-plugin. Contains tests 
and example in showcase app. The new result type is intended to be used along 
with existing JSONValidationInterceptor. It makes it possible to do form 
validation via ajax and handle form submitting, action execution and redirect 
evaluation all in one request inside JS context.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@struts.apache.org
For additional commands, e-mail: dev-h...@struts.apache.org

Reply via email to