How to display my application's errors in JSF?

后端 未结 8 1544
栀梦
栀梦 2020-11-29 18:10

In my JSF/Facelets app, here\'s a simplified version of part of my form:


  

        
8条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-29 18:41

    In case anyone was curious, I was able to figure this out based on all of your responses combined!

    This is in the Facelet:

    
      
      
      
      
      
    
    

    This is in the continueButton() method:

    FacesContext.getCurrentInstance().addMessage("myForm:newPassword1", new FacesMessage(PASSWORDS_DONT_MATCH, PASSWORDS_DONT_MATCH));
    

    And it works! Thanks for the help!

提交回复
热议问题