[ 
https://issues.apache.org/jira/browse/WW-4139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14997607#comment-14997607
 ] 

ASF GitHub Bot commented on WW-4139:
------------------------------------

GitHub user LukaszRacon opened a pull request:

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

    Form.getValidators does not respect validateAnnotatedMethodOnly flag

    WW-4139 removed method name from getValidators call.  While this works
    fine for a case mentioned in that ticket it fails to account for a case
    when
    dynamicMethodCalls and validateAnnotatedMethodOnly are used. Without
    method name actionValidatorManager.getValidators returns all validators
    defined for a given field.
    Expected behavior for dynamicMethodCalls with
    validateAnnotatedMethodOnly case is to return validators for a given
    field defined at the method level.

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

    $ git pull https://github.com/LukaszRacon/struts form-validators

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

    https://github.com/apache/struts/pull/57.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 #57
    
----
commit ee562666abf01faf4dd73f65c9f4d77b079423d1
Author: Lukasz Racon <[email protected]>
Date:   2015-11-09T23:02:02Z

    Form.getValidators does not respect validateAnnotatedMethodOnly flag
    
    WW-4139 removed method name from getValidators call.  While this works
    fine for a case mentioned in that ticket it fails to account for a case
    when
    dynamicMethodCalls and validateAnnotatedMethodOnly are used. Without
    method name actionValidatorManager.getValidators returns all validators
    defined for a given field.
    Expected behavior for dynamicMethodCalls with
    validateAnnotatedMethodOnly case is to return validators for a given
    field defined at the method level.

----


> Validation of non-default methods not being executed
> ----------------------------------------------------
>
>                 Key: WW-4139
>                 URL: https://issues.apache.org/jira/browse/WW-4139
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.3.15
>            Reporter: Bruno Klava
>            Assignee: Lukasz Lenart
>             Fix For: 2.3.16
>
>
> Code sample: https://github.com/bklava/struts
> In the example, in the index action/page, there are 2 forms: the difference 
> is that the form 1 submits to the action without setting a method (then 
> calling the default execute() method), while the form 2 submits to the same 
> action but calling a specific method.
> The validator is set annotating the field setter method, so it should be 
> available either to the default execute method and to the non-default method. 
> This is exactly the behaviour obtained when using Struts 2.3.14.3.
> After switching to Struts 2.3.15, the form 2 validation is not executed at 
> all.
> As far as I can tell, this difference is due to changes made in 
> org.apache.struts2.components.Form.getValidators(String name)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to