Teeda 的LayOut(zhuan)

 

就是整个站点页面的显示区域框架的预定义模式,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>

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值