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:14:34 UTC

[jira] Issue Comment Edited: (WW-2050) Separate JSONValidationInterceptor from AnnotationValidationInterceptor

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

musachy edited comment on WW-2050 at 8/21/07 4:13 PM:
--------------------------------------------------------------

I always forget that about the DefaultWorkflowInterceptor. I think it is a bug and I don't see any reason why validation should performed there at all. I will log an issue for it. As for the radiobuttons, I will reopen the issue to address that, I had no idea it was breaking there.

      was (Author: musachy):
    I always for that about DefaultWorkflowInterceptor, I think it is a bug and I don't see any reason why validation should performed there at all. I will log an issue for it. As for the radiobuttons, I will reopen the issue to address that, I had no idea it was breaking there.
  
> 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.