Home | 簡體中文 | 繁體中文 | 雜文 | 知乎專欄 | Github | OSChina 博客 | 雲社區 | 雲棲社區 | Facebook | Linkedin | 視頻教程 | 打賞(Donations) | About
知乎專欄多維度架構 | 微信號 netkiller-ebook | QQ群:128659835 請註明“讀者”

16.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>