Home | 简体中文 | 繁体中文 | 杂文 | 打赏(Donations) | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 知乎专栏 | Search | Email

18.2. Template 配置模板

WEB-INF/tiles.xml

		
<tiles-definitions>
	<definition name="index" path="/WEB-INF/jsp/index.jsp">
	    <put name="title"  value="Tiles Example" />
	    <put name="header" value="/WEB-INF/jsp/header.jsp" />
	    <put name="menu"   value="/WEB-INF/jsp/menu.jsp" />
	    <put name="body"   value="/WEB-INF/jsp/body.jsp" />
	    <put name="footer" value="/WEB-INF/jsp/footer.jsp" />
	</definition>
	<definition name="template_mobile" template="/WEB-INF/jsp/mobile/template.jsp">
		<put-attribute name="header" value="/WEB-INF/jsp/mobile/header.jsp" />
		<put-attribute name="content" value="" />
		<put-attribute name="footer" value="/WEB-INF/jsp/mobile/footer.jsp" />
	</definition>
</tiles-definitions>
		
		

/WEB-INF/jsp/mobile/template.jsp

		
<%@page pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>www.netkiller.cn</title> 
</head>
<body>

<tiles:insertAttribute name="header" ignore="true" />

<tiles:insertAttribute name="content" ignore="true" />

<tiles:insertAttribute name="footer" ignore="true" />

</body>
</html>