就是整个站点页面的显示区域框架的预定义模式,head,foot,menu等可以一次定义,所有页面继承
如何指定这个页,默认情况是在 view/layout/layout.html
修改默认 在web.xml中
<context-param>
<param-name>teeda.DEFAULT_LAYOUT_PATH</param-name>
<param-value>/layout/myLayout.html</param-value>
</context-param>
其他页如何使用Layout 只要在pageClass 中指定 方法getLayout()并且返回值是使用这个LayOut的PageClass就可以
public Class getLayout() {
return OtherLayoutPage.class;
}
layout构成元素
Head: 中的 <link><script><style>都可以使用,但是<title>是requset 返回的 不用写
te:includeChildBody要素:<body> 中使用,requst后,就用你要访问的页面替换掉了,可以复数使用,但是不能省略。
te:include:te:src 指定相应的画面,如下面的代码
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:te="http://www.seasar.org/teeda/extension">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Teeda HTML example2</title>
<link rel="stylesheet" type="text/css" href="../../../css/litbox.css" />
<script type="text/javascript" src="../../js/kumu.js"></script>
<script type="text/javascript" src="../../js/event.js"></script>
<script type="text/javascript" src="../../js/ajax.js"></script>
<script type="text/javascript" src="../../js/prototype.js"></script>
<script type="text/javascript" src="../../js/effects.js"></script>
<script type="text/javascript" src="../../js/dragdrop.js"></script>
<script type="text/javascript" src="../../js/litbox.js"></script>
</head>
<body>
<table border="0" cellspacing="5">
<tr>
<td colspan="2"><te:include id="layoutHeader" te:src="/layout/header.html"/></td>
</tr>
<tr>
<td width="140" valign="top">
<te:include id="layoutMenu" te:src="/layout/menu.html"/>
</td>
<td valign="top" align="left">
<te:includeChildBody id="layoutChildBody"/>
</td>
</tr>
<tr>
<td colspan="2">
<hr/>
</td>
</tr>
<tr>
<td colspan="2">
<te:include id="layoutFooter" te:src="/layout/footer.html"/>
</td>
</tr>
</table>
</body>
</html>