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/08/22 01:18:34 UTC

[jira] Commented: (WW-2050) Separate JSONValidationInterceptor from AnnotationValidationInterceptor

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

Musachy Barroso commented on WW-2050:
-------------------------------------

The ticket for removing the validation code from the workflow interceptor is WW-2072

> Separate JSONValidationInterceptor from AnnotationValidationInterceptor
> -----------------------------------------------------------------------
>
>                 Key: WW-2050
>                 URL: https://issues.apache.org/struts/browse/WW-2050
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Interceptors
>    Affects Versions: 2.1.0
>            Reporter: Lukasz Racon
>            Assignee: Musachy Barroso
>            Priority: Minor
>             Fix For: 2.1.0
>
>         Attachments: jsonvalidator.diff, validation2.js
>
>
> Since JSONValidationInterceptor extends AnnotationValidationInterceptor it should behave exactly as AnnotationValidationInterceptor does.
> Here are the problems:
> - JSONValidationInterceptor ignores @SkipValidation
> - it always performs jason validation. You have to have separate stacks for different validation strategies. IMHO as a replacement it should as default let the workflow/annotationWorkflow controller to decide what to do.
> - JSON validation should be triggered by a request parameter (for example set by the sx:submit tag, or to be precise by Bind widget)
> Proposed solution:
> JSONValidationInterceptor should be an interceptor (not a validating one). It should be positioned in the stack after the 'validation' and before 'workflow'. This way its sole purpose would be to check for request param trigger and action that has errors and return errors as json. Other interceptors will be responsible for validation and setting the errors on the action. This setup would allow JSON validation to coexist with old submit form validation - meaning you would have one stack for both. 

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