[ 
https://issues.apache.org/struts/browse/WW-2217?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Oleg Gorobets updated WW-2217:
------------------------------

          Flags: [Patch]
    Description: 
Seems like DWR validator is ignoring action method when creating proxy. 
Therefore ajax validation is always run on execute() method. See code below.

===================================================================
DWRValidator.java
===================================================================
 Configuration cfg = du.getConfigurationManager().getConfiguration();
 ValidatorActionProxy proxy = new ValidatorActionProxy(namespace, action, ctx);
cfg.getContainer().inject(proxy);
            proxy.prepare();
            proxy.execute();
===================================================================

Possibly should be changed to something like
===================================================================
            Configuration cfg = du.getConfigurationManager().getConfiguration();
            String method = null;
            if (action.indexOf('!')>=0) {
                             method = action.substring(action.indexOf('!')+1);
                        action = action.substring(0,action.indexOf('!'));
            }
            ValidatorActionProxy proxy = new ValidatorActionProxy(namespace, 
action, ctx);
            if (method != null) {
                             proxy.setMethod(method);
            }
            cfg.getContainer().inject(proxy);
            proxy.prepare();
            proxy.execute();
===================================================================

  was:
Seems like DWR validator is ignoring action method when creating proxy. 
Therefore ajax validation is always run on execute() method. See code below.

===================================================================
DWRValidator.java
===================================================================
 Configuration cfg = du.getConfigurationManager().getConfiguration();
 ValidatorActionProxy proxy = new ValidatorActionProxy(namespace, action, ctx);
cfg.getContainer().inject(proxy);
            proxy.prepare();
            proxy.execute();
===================================================================


> DWRvalidator ignores method when creating action proxy
> ------------------------------------------------------
>
>                 Key: WW-2217
>                 URL: https://issues.apache.org/struts/browse/WW-2217
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Validation
>    Affects Versions: 2.0.8
>         Environment: Windows XP SP2, JBoss-4.2.0, Firefox/2.0.0.7
>            Reporter: Oleg Gorobets
>
> Seems like DWR validator is ignoring action method when creating proxy. 
> Therefore ajax validation is always run on execute() method. See code below.
> ===================================================================
> DWRValidator.java
> ===================================================================
>  Configuration cfg = du.getConfigurationManager().getConfiguration();
>  ValidatorActionProxy proxy = new ValidatorActionProxy(namespace, action, 
> ctx);
> cfg.getContainer().inject(proxy);
>             proxy.prepare();
>             proxy.execute();
> ===================================================================
> Possibly should be changed to something like
> ===================================================================
>             Configuration cfg = 
> du.getConfigurationManager().getConfiguration();
>             String method = null;
>             if (action.indexOf('!')>=0) {
>                            method = action.substring(action.indexOf('!')+1);
>                       action = action.substring(0,action.indexOf('!'));
>             }
>             ValidatorActionProxy proxy = new ValidatorActionProxy(namespace, 
> action, ctx);
>             if (method != null) {
>                            proxy.setMethod(method);
>             }
>             cfg.getContainer().inject(proxy);
>             proxy.prepare();
>             proxy.execute();
> ===================================================================

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

Reply via email to