문제

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