h:messages |
|
The messages tag renders all Faces messages for the current view. You can
customize the messages generated by this component by applying different CSS
styles depending on the severity level of the messages (eg. red for error, green
for information) as well as changing the detail level of the messages. The
messages tag supports two layouts for the generated messages:an HTML table or a
bulleted list. The default layout is the list format. You can also customize the
standard error messages by overriding specific JSF properties in your message
bundle.
JSF Example
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html">
<h:head />
<body>
<h:form>
<h:messages errorStyle="color:red" />
<h:inputText required="true" label="My Input" />
<h:commandButton value="Click" />
</h:form>
</body>
</html>
This example was formatted by JSFToolbox for Dreamweaver.
Rendered Output
|