• Post Reply Bookmark Topic Watch Topic
  • New Topic

Choose what appears in h:messages

 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I understand that h:messages are for global messages. But it gets annoying when I also have an h:message tag because what appears in the h:message also appears in h:messages. It's redundant. I have two methods that add messages and error messages




and my JSF looks as follows


How can I make sure that only messages that I added in my controller using addErrorMessage and addSuccessMessage only appear in <h:messages>? Thanks!
 
Ravindra Rawat
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Timothy,

If i get it correctly, you want global messages to display on top and component specific messages with components.

For adding global messages use


And in your JSP,
in h:messages.

Regards
Ravindra
 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much! That solved the problem.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!