如何插入巢瓷砖
你好: 我知道如何在jsp页面中插入属性和定义,但我无法插入嵌套的图块。
这是例子:
<definition name="/commonPage" template="/jsp/common/template.jsp">
<put-attribute name="header" value="/jsp/common/defaultHeader.jsp" />
<put-attribute name="menu" value="/jsp/common/defaultMenu.jsp" />
<put-attribute name="footer" value="/jsp/common/defaultFooter.jsp" />
</definition>
<definition name="/all" extends="/commonPage">
<put-attribute name="body" value="/jsp/all_body.jsp" />
<put-list-attribute name="scriptList">
<add-attribute value="/res/script/all.js" />
</put-list-attribute>
</definition>
<definition name="/time" extends="/commonPage">
<put-attribute name="timebar" value="/jsp/common/timebar.jsp" />
<put-attribute name="body" value="/jsp/time_body.jsp" />
<put-list-attribute name="scriptList"></put-list-attribute>
</definition>
</tiles-definitions>
在 tempalte.jsp 中:
....
<tiles:insertAttribute name="meun">
...
<tiles:insertAttribute name="footer">
现在,在 time_body.jsp 中,我想插入另一个 jsp -- timebar.jsp。
所以我在“/time”的定义中定义了该属性,但是它不起作用。
这是 time_body.jsp 中的代码:
<div class="div_fullwidth">
<tiles:insertAttribute name="timebar" />
</div>
有什么想法吗?
Hi:
I know how to insert the attribut and defination in the jsp page,but I can not insert a nestly tiles.
This is the exmaple:
<definition name="/commonPage" template="/jsp/common/template.jsp">
<put-attribute name="header" value="/jsp/common/defaultHeader.jsp" />
<put-attribute name="menu" value="/jsp/common/defaultMenu.jsp" />
<put-attribute name="footer" value="/jsp/common/defaultFooter.jsp" />
</definition>
<definition name="/all" extends="/commonPage">
<put-attribute name="body" value="/jsp/all_body.jsp" />
<put-list-attribute name="scriptList">
<add-attribute value="/res/script/all.js" />
</put-list-attribute>
</definition>
<definition name="/time" extends="/commonPage">
<put-attribute name="timebar" value="/jsp/common/timebar.jsp" />
<put-attribute name="body" value="/jsp/time_body.jsp" />
<put-list-attribute name="scriptList"></put-list-attribute>
</definition>
</tiles-definitions>
And in the tempalte.jsp:
....
<tiles:insertAttribute name="meun">
...
<tiles:insertAttribute name="footer">
Now,in the time_body.jsp,I want to insert another jsp -- timebar.jsp.
So I define the attribute in the definition of "/time",however it does not work.
This is the codes in the time_body.jsp:
<div class="div_fullwidth">
<tiles:insertAttribute name="timebar" />
</div>
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您尝试执行此操作时,是否收到任何错误消息?
编辑:
所以这是我的图块配置 - 我正在使用 spring:
基本布局 - 保留一般布局结构,而正文标记中没有页面特定内容:
页面特定视图:
所以在该页面特定视图“建议/列表”中我想添加一个新的部分 我会这样做:
然后我将简单地调用建议/列表模板中的属性。
顺便说一句:我在 pom.xml 中使用该依赖项
Did you get any error messages when you try to do that?
Edited:
So this is my tiles configuration - I'm using spring:
Basic layout - holds general layout structure without page specific content in the body tag:
Page specific views:
So in that page specific view "advice/list" I want to add a new partial I'll do that:
And then I will call simply the attribute in the advice/list template.
btw: I'm using that dependency in my pom.xml