0
定義圖塊定義或屬性時,是否可以引用另一個定義或屬性而不繼承?在Tiles 2中,有沒有辦法引用另一個定義或屬性而不直接繼承?
我有各種各樣的被認爲是「常見」的JSP片段,CSS和JavaScript。它們當然不是每個頁面都需要的,因此直接繼承似乎不會起作用。
例子:
<tiles-definitions>
<definition name="currentBodyDefinition" template="[...specific body template...]" extends="Components">
<!-- if it's not already defined within Components, add it here -->
</definition>
<definition name="page" extends="pageTemplate">
<put-attribute name="body" value="currentBodyDefinition" />
<put-attribute name="scripts" value="[...???...]" /> <!-- can I reference another definition(s) or attribute(s) here??? -->
<put-attribute name="styles" value="[...???...]" /> <!-- can I reference another definition(s) or attribute(s) here??? -->
</definition>
</tiles-definitions>