2014-01-23 169 views
0

我正在使用struts2-archetype-starter maven模板創建Struts2 webapp。雖然之前我使用過Struts2,但我是Sitemesh的新手。我在我的decorator文件夾一個adminTemplate.jsp,包含一個Sitemesh 2.4.2:如何使用除裝飾器之外的裝飾器

<decorator:body />

標籤。正如我們所知,身體不是我們可能想要定製的唯一東西,我需要在我的頁面中使用一些自定義腳本<decorator:body />高於頁腳(不是很好放置您的腳本)。

我也試過指由的sitemesh提供的文檔,在這裏: -

http://wiki.sitemesh.org/display/sitemesh/Passing+Additional+Elements+to+the+Decorator

但不幸的是,該頁面沒有任何文字的。

任何人都可以請告訴我如何實現相同?如果有人能留下一些好文檔的提示,這將會非常有幫助。

回答

2

你可以在adminTemplate.jsp

插入 佔位
<head> 
    <title> 
    <decorator:title/> 
    </title> 
    ... 
    ... 
    <decorator:head/> 
</head> 

然後定製scriptes在你的頁面。

<head> 
    <title> 
    page1 
    </title> 
    <script> 
    .... 
    </script> 
</head> 
相關問題