I am using struts2-archetype-starter maven template to create Struts2 webapp. Though, I used Struts2 before, I am new to Sitemesh. I have one adminTemplate.jsp in my decorator folder, containing one

<decorator:body />

tag. As we know, body is not the only thing we might want to customize, I need some custom scripts in my page. <decorator:body /> comes above footer (not very good place your scripts).

I also tried to refer to the docs provided by sitemesh, here:-

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

But, unfortunately, the page is not having any text at all.

Can anybody please tell me how to achieve the same? It will be very helpful if anybody can leave pointers to some good docs as well.

有帮助吗?

解决方案

you can insert the head placeholder in the adminTemplate.jsp

<head>
  <title>
    <decorator:title/>
  </title>
  ...
  ...
  <decorator:head/>
</head>

then custom scriptes in your pages.

<head>
  <title>
    page1
  </title>
  <script>
    ....
  </script>
</head>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top