It's not a secret anymore!
The moose likes JSF and the fly likes difference between h:messages & h:message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "difference between h:messages & h:message" Watch "difference between h:messages & h:message" New topic

difference between h:messages & h:message

lynn fann
Ranch Hand

Joined: Oct 15, 2006
Posts: 115
im trying to print out the error message using h:message but it is not shown. From the log i have the following statement:
INFO: WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
sourceId=appt[severity=(ERROR 2), summary=(date and time not entered.), detail=(date and time not entered.)]

However, when i use h:messages to display the error message, it is shown.

Why is this so??

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

h:message is a specific message for a specific control. h:messages is a message container.

The log entry you're getting is saying that you (or some software) entered a message into the messages container, but no tag pulled it out and displayed that message. Which is basically exactly what the log entry says.

If I'm reading it correctly, adding a tag "<h:message for="appt"/>" should provide a way to display that message.

An IDE is no substitute for an Intelligent Developer.
lynn fann
Ranch Hand

Joined: Oct 15, 2006
Posts: 115
i have the following line on my jsp page.

<h:inputText id="appt" value="#{myBean.dateSelect}"/>
<h:message for="appt"/>

in my managed bean i have the following
FacesMessage message = new FacesMessage();
message.setSummary("date and time not entered.");
message.setDetail("date and time not entered.");
context.addMessage("appt", message);
return null;

with these lines, i have the above stated error. What/where have i gone wrong?

I agree. Here's the link:
subject: difference between h:messages & h:message
It's not a secret anymore!