Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-4949

Seam annotated JSF validator breaks JPDL navigation

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.3.0.BETA1
    • Fix Version/s: None
    • Component/s: JSF Integration
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      Follow the incident description

      Show
      Follow the incident description
    • Workaround Description:
      Hide

      Annotated JSF validators using @javax.faces.validator.FacesValidator rathen than Seam tags

      Show
      Annotated JSF validators using @javax.faces.validator.FacesValidator rathen than Seam tags

      Description

      An seam annotated JSF validator does not behave as it should when used within a JPDL navigation.

      For example, the following JSF form should go to the second page in the pageflow after "conversationTest.success()" method is executed. If the "myValidator" is annotated using @FacesValidator, everything is fine. Otherwise, if it is validated using seam tags, the framework starts a new conversation after the button is clicked.

      <h:form>
          <div>
              <h:inputText id="textInput" value="#{conversationTest.text}">
                  <f:validator validatorId="myValidator"/>  
              </h:inputText>
          </div>
          <h:commandButton action="#{conversationTest.success}" value="Success" />
      </h:form>
      

      If the validator is annotated as following, everything is fine:

      MyValidator.java
      package com.example.validator;
      
      import javax.faces.component.UIComponent;
      import javax.faces.context.FacesContext;
      import javax.faces.validator.ValidatorException;
      
      @javax.faces.validator.FacesValidator("myValidator")
      public class FacesValidator implements javax.faces.validator.Validator{
      	
      	public void validate(FacesContext facesContext, UIComponent uIComponent, Object bDate) throws ValidatorException {
      		// empty method. Don't do anything
      	}
      }
      

      Othewise, it the validator is annotated as following the JPDL annotation is broken:

      MyValidator.java
      package com.example.validator;
      
      import javax.faces.component.UIComponent;
      import javax.faces.context.FacesContext;
      import javax.faces.validator.ValidatorException;
      
      import org.jboss.seam.ScopeType;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.annotations.Scope;
      import org.jboss.seam.annotations.faces.Validator;
      import org.jboss.seam.annotations.intercept.BypassInterceptors;
      
      @Name("myValidator")
      @BypassInterceptors
      @Scope(ScopeType.STATELESS)
      @Validator
      public class SeamValidator implements javax.faces.validator.Validator{
          
          public void validate(FacesContext facesContext, UIComponent uIComponent, Object bDate) throws ValidatorException {
      		// empty method. Don't do anything
          }
      }
      

      This issue is probably related to JBSEAM-4944

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ciaccia Andrea Martino
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated: