Message Example
Here is an application that
displays error messages using both tags.
Here is the
JSP page for the form.
Note that the input tags and message tags are laid out using the HTML
table element.
To automatically generate messages:
- For missing input, set the input tag's required attribute to
"true".
- For input that does not parse as an integer, wire the bean to an integer
bean property. Here is the
UserBean class.
To give the messages a particular font style (e.g. italic) or color
(e.g. red), use the errorClass attribute and provide a style sheet.
Here is the styles.css file for the
messages application.