tiles的使用问题

wangxiaomax wangxiaomax 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
ListLayout.jsp布局文件
<html>
<head>
<title>
<tiles:getAsString name="title" ignore="true"/>
</title>
</head>
<BODY>
<tiles:insert attribute="head" ignore="true"/>
<%
//如何显示title
//out.println(title);
%>
<tiles:insert attribute="footer" ignore="true"/>
</body>
</html>

tiles_defs.xml定义文件
<definition name="ListLayoutDef" path="/tiles/ListLayout.jsp">
<put name="title" type="string" value="List Page" />
<put name="head" value="/head.jsp" />
<put name="footer" value="/footer.jsp" />
</definition>

TestList.jsp使用布局文件
<tiles:insert definition="ListLayoutDef" flush="true">
<tiles:put name="title" type="string">
hello world
</tiles:put>
</tiles:insert>

由于我的查询页面,里面有很多重复的JAVA代码,所以我要把此重复代码放在布局文件里。这样就出现了一个问题,如何在布局文件ListLayout.jsp里的JAVA代码里取TestList.jsp文件里PUT的值。也就是如何显示title?
...全文
评论 3
收藏 已收藏
分享
返回顶部
wangxiaomax
Web 开发 81,108 成员 341,720 内容