How to display my application's errors in JSF?

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

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


  

        
8条回答
  •  野性不改
    2020-11-29 18:43

    You also have to include the FormID in your call to addMessage().

     FacesContext.getCurrentInstance().addMessage("myform:newPassword1", new FacesMessage("Error: Your password is NOT strong enough."));
    

    This should do the trick.

    Regards.

提交回复
热议问题