Java Reference
In-Depth Information
Figure 6.3: Customizing the display of information messages
6.2
Customizing Error Messages
Error messages can be customized in the same way as information mes-
sages, but they also support additional features. They can be displayed
in a group or individually next to the input field associated with the
error. The labels and input fields that are in error can be highlighted.
The message text can be modified. With all these features, we can dis-
play error messages so that they fit in well with the look and feel of our
web application.
Error Messages in a Group
Much like the <s:messages/> tag, the <s:errors/> tag generates HTML
code using the values defined in StripesResources.properties . The keys
start with stripes.errors and have the default values shown in the fol-
lowing code. This displays error messages as in the example shown in
Figure 6.4 , on the next page.
Download email_07/res/StripesResources.properties
stripes.errors.header=<div style="color:#b72222; font-weight: bold">\
Please fix the following errors:</div><ol>
stripes.errors.beforeError=<li style="color: #b72222;">
stripes.errors.afterError=</li>
stripes.errors.footer=</ol>
 
 
 
 
Search WWH ::




Custom Search