xmlns:spring="http://www.springframework.org/tags">
<jsp:output doctype-root-element="HTML" doctype-system="about:legacy-compat" />
<jsp:directive.page contentType="text/html;charset=UTF-8" />
<jsp:directive.page pageEncoding="UTF-8" />
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<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}" />
<!-- Get the user locale from the page context (it was set by Spring MVC's locale
resolver) -->
<c:set var="userLocale">
<c:set var="plocale">${pageContext.response.locale}</c:set>
<c:out value="${fn:replace(plocale, '_', '-')}" default="en" />
</c:set>
<spring:message code="application_name" var="app_name" htmlEscape="false"/>
<title><spring:message code="welcome_h3" arguments="${app_name}" /></title>
</head>
<body class="tundra spring">
<div id="headerWrapper">
<tiles:insertAttribute name="header" ignore="true" />
</div>
<div id="wrapper">
<tiles:insertAttribute name="menu" ignore="true" />
<div id="main">
<tiles:insertAttribute name="body"/>
<tiles:insertAttribute name="footer" ignore="true"/>
</div>
</div>
</body>
</html>
The page is basically a JSP page. The highlights are as follows:
The <spring:theme> tag is placed in the template, which supports theming at the
·
template level.
The <tiles:insertAttribute> tag is used to indicate the page components that
·
need to be loaded from other files, as indicated in the layouts.xml file.
Now let's implement the header, menu, and footer components. The contents are shown in Listings
17-21, 17-22, and 17-23, respectively.
Listing 17-21. The Header Component (header.jspx)
<div id="header" xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:spring="http://www.springframework.org/tags"
Search WWH :
Custom Search
Previous Page
Spring Framework 3 Topic Index
Next Page
Spring Framework 3 Bookmarks
Home