【 tulaoshi.com - Web开发 】
                             
                            代码如下:
?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动态地更换。 
在模版页面的java类里边添加类似如下代码: 
代码如下:
@Parameter(defaultPrefix = BindingConstans.LITERAL,name = "title",requred=true)//这里我设为参数必须 
@Property(write=false)//标注不可写的属性 
private String title;
最后在使用时: 
代码如下:
div t:type="模版" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd" 
XXX 
/div 
再重新布置服务器后,已经发现可以显示出正常的标题属性了。。。。