如何为特定视图定义图块定义
How to define tiles definition for a specific view
所以我的图块定义如下所示,我想知道如何管理它以在特定视图上显示特定模板:
我想要默认模板 ist "commonPage" 和例如"/monitor1" return 值我希望应用空模板。
<tiles-definitions>
<definition name="commonPage" template="/WEB-INF/tiles/layouts/topmenulayout.jsp">
<put-attribute name="header" value="/WEB-INF/tiles/jsp/header.jsp" />
<put-attribute name="menu" value="/WEB-INF/views/menu.jsp" />
<put-attribute name="footer" value="/WEB-INF/tiles/jsp/footer.jsp" />
</definition>
<definition name="emptyPage" template="/WEB-INF/tiles/layouts/emptylayout.jsp">
</definition>
<!-- Views ending in "Dialog" have no header, menu or -->
<!-- footer. Useful for creating jQuery popup dialogs. -->
<definition name="*/*Dialog" template="/WEB-INF/views/{1}/{2}Dialog.jsp" />
<definition name="*Dialog" template="/WEB-INF/views/{1}Dialog.jsp" />
<!-- All other views get the header, menu and footer tiles. -->
<!-- I want commonPage as default template, and e.g. for "/Monitor1" return value I want the emptyLayout -->
<definition name="*" extends="commonPage">
<put-attribute name="body" value="/WEB-INF/views/{1}.jsp" />
</definition>
</tiles-definitions>
很容易解决。
我添加了以下定义,它按照我想要的方式工作:
<definition name="*Monitor1" extends="emptyPage">
所以我的图块定义如下所示,我想知道如何管理它以在特定视图上显示特定模板: 我想要默认模板 ist "commonPage" 和例如"/monitor1" return 值我希望应用空模板。
<tiles-definitions>
<definition name="commonPage" template="/WEB-INF/tiles/layouts/topmenulayout.jsp">
<put-attribute name="header" value="/WEB-INF/tiles/jsp/header.jsp" />
<put-attribute name="menu" value="/WEB-INF/views/menu.jsp" />
<put-attribute name="footer" value="/WEB-INF/tiles/jsp/footer.jsp" />
</definition>
<definition name="emptyPage" template="/WEB-INF/tiles/layouts/emptylayout.jsp">
</definition>
<!-- Views ending in "Dialog" have no header, menu or -->
<!-- footer. Useful for creating jQuery popup dialogs. -->
<definition name="*/*Dialog" template="/WEB-INF/views/{1}/{2}Dialog.jsp" />
<definition name="*Dialog" template="/WEB-INF/views/{1}Dialog.jsp" />
<!-- All other views get the header, menu and footer tiles. -->
<!-- I want commonPage as default template, and e.g. for "/Monitor1" return value I want the emptyLayout -->
<definition name="*" extends="commonPage">
<put-attribute name="body" value="/WEB-INF/views/{1}.jsp" />
</definition>
</tiles-definitions>
很容易解决。 我添加了以下定义,它按照我想要的方式工作:
<definition name="*Monitor1" extends="emptyPage">