欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

java tapestry5 布局 參數(shù)的處理

 更新時間:2009年07月23日 23:04:13   作者:  
在使用時,希望把里邊的title,keywords,description動態(tài)地更換。
復(fù)制代碼 代碼如下:

<?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:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<head>
<meta name="keywords" content="${ks}">
<meta name="description" content="${desc}">
<title>${title}</title>
</head>
<body >
<t:body/>
</body>

例如如上一個模版頁面,在使用時,希望把里邊的title,keywords,description動態(tài)地更換。
在模版頁面的java類里邊添加類似如下代碼:
復(fù)制代碼 代碼如下:

@Parameter(defaultPrefix = BindingConstans.LITERAL,name = "title",requred=true)//這里我設(shè)為參數(shù)必須\
@Property(write=false)//標(biāo)注不可寫的屬性
private String title;

最后在使用時:
復(fù)制代碼 代碼如下:

<div t:type="模版" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd" title="這里寫你的參數(shù)">
XXX
</div>

再重新布置服務(wù)器后,已經(jīng)發(fā)現(xiàn)可以顯示出正常的標(biāo)題屬性了。。。。

相關(guān)文章

最新評論