Java Reference
In-Depth Information
Figure 6.2: The default display of information messages
With the icon image file in images/info.gif , the following code will generate
the message box:
Download email_08/res/StripesResources.properties
stripes.messages.header=<div class="messages">\
<img src="images/info.gif"/>
stripes.messages.beforeMessage=<p>
stripes.messages.afterMessage=</p>
stripes.messages.footer=</div>
The following CSS code displays the box with a border, a shaded back-
ground, and the message text in bold:
Download email_08/web/css/style.css
div.messages {
display: block;
border: 2px solid #008800;
margin-bottom: 8px;
background-color: #CCFFCC;
}
div.messages p {
font-weight: bold;
color: #008800;
margin: 0;
}
As we can see, customizing the display of messages is just a matter
of changing a few entries in the properties file. We can also use style
classes and customize the appearance with CSS code.
Any part that Stripes uses to construct the code ( header , beforeMessage ,
afterMessage , and footer ) can be left blank. For example, we could use
stripes.messages.footer= if we don't need a footer.
 
 
 
Search WWH ::




Custom Search