Propagating a Tiles attribute down the include chain

点点圈 提交于 2019-12-03 05:11:31

To propagate the title attribute to inner templates you need to add cascade="true" attribute to the title's <put-attribute> tag, like this:

<definition name="tutorial" extends="page">
  <put-attribute name="title" cascade="true" value="Tutorial"/>
  <put-attribute name="body" value="/WEB-INF/jsp/tutorial.jsp"/>
</definition>

Take care to upgrade the Tiles definition file to 2.1 min, as cascade is available since 2.1.

<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 2.1//EN" "http://tiles.apache.org/dtds/tiles-config_2_1.dtd">

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!