img
<spring:message code="label_contact_birth_date" var="labelContactBirthDate"/>
<head>
<spring:theme code="styleSheet" var="app_css" />
<spring:url value="/${app_css}" var="app_css_url" />
<link rel="stylesheet" type="text/css" media="screen" href="${app_css_url}" />
</head>
<h1>${labelContactList}</h1>
<!-- Other code omitted -->
</div>
In Listing 17-18, the new code is highlighted in bold. A <head> section is added in the view, and the
<spring:theme> tag is used to retrieve the styleSheet property from the theme's ResourceBundle, which
is the style sheet file standard.css. Finally, the link to the style sheet is added into the view.
After rebuilding and redeploying the application to the server, open the browser and point to the
contact list view's URL again (http://localhost:8080/ch17/contacts), and you will see that the style
defined in standard.css file was applied, as shown in Figure 17-8.
Figure 17-8. The contact list view with theme support enabled
Using Spring MVC's theme support, you can easily add new themes or change the existing theme
within your application.
Search WWH :
Custom Search
Previous Page
Spring Framework 3 Topic Index
Next Page
Spring Framework 3 Bookmarks
Home