0
votes

I have a JSP with a managed bean. I want to display a message on the page, not related to any component, so, I do not need to use the "for" attribute.

My message code:
public void foo(ActionEvent event)
{
 FacesContext context= FacesContext.getCurrentInstance();
 if(true)
 {
  FacesMessage message = new FacesMessage();
  message.setSeverity(FacesMessage.SEVERITY_ERROR);
  message.setSummary("BMW.");
  message.setDetail("BMW detail.");
  context.addMessage("foo", message);
  }
}

How do I display this message?

1
oops, didn't see that you've already given the answer yourself via comment. Sorry for duplicating it. - Gerhard Dinhof

1 Answers

1
votes

Sounds like the <ice:messages /> tag will be the right choice for you.

ICEfaces ice:messages TLD