How to display my application's errors in JSF?

后端 未结 8 1543
栀梦
栀梦 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:42

    Remember that:

    FacesContext context = FacesContext.getCurrentInstance();
    context.addMessage( null, new FacesMessage( "The message to display in client" ));            
    

    is also valid, because when null is specified as first parameter, it is applied to the whole form.

    More info: coreservlets.com //Outdated

提交回复
热议问题