Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4139

Validation of non-default methods not being executed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.15
    • 2.3.16
    • None
    • None

    Description

      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)

      Attachments

        Activity

          People

            lukaszlenart Lukasz Lenart
            bklava Bruno Klava
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: