Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-11864

Only one JSF Validator is invoked when defined via annotation @FacesValidator

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • 16.0.0.Final
    • JSF
    • Hide

      Deploy attached ears

      Hit these urls and enter a value, click submit

      http://localhost:8080/annotations/main.xhtml
      http://localhost:8080/xml/main.xhtml

      Check the server.log, when the validators are defined in faces-config.xml both will be invoked. When defined with @FacesValidator only the first validator gets invoked.

      Show
      Deploy attached ears Hit these urls and enter a value, click submit http://localhost:8080/annotations/main.xhtml http://localhost:8080/xml/main.xhtml Check the server.log, when the validators are defined in faces-config.xml both will be invoked. When defined with @FacesValidator only the first validator gets invoked.
    • Workaround Exists
    • Hide

      Define the validators in the faces-config.xml instead of via annotations

      Show
      Define the validators in the faces-config.xml instead of via annotations

      Only one JSF Validator is invoked when defined via annotation @FacesValidator

      @FacesValidator(value = "validator.CustomValidator1", managed = true)
      public class CustomValidator1 implements Validator<String> {
         ...
      }
      @FacesValidator(value = "validator.CustomValidator2", managed = true)
      public class CustomValidator2 implements Validator<String> {
         ...
      }
      
                      <h:inputText id="input-value" value="#{customBean.inputValue}">
                        <f:validator validatorId="validator.CustomValidator2" />
                        <f:validator validatorId="validator.CustomValidator1" />
                      </h:inputText>
      

              chaowan@redhat.com Chao Wang
              chaowan@redhat.com Chao Wang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: