I am trying to use Sitemesh 3 to control the decoration of JSP output from a Spring MVC application.
When I hit the application it seems that Sitemesh is making a re
Here is another blog that shows the integration between Sitemesh 3 and Spring MVC
Since no one has posted actual content, here you go:
in pom.xml
add:
<dependency>
<groupId>org.sitemesh</groupId>
<artifactId>sitemesh</artifactId>
<version>3.0.0</version>
</dependency>
in WEB-INF/web.xml
† add:
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>org.sitemesh.config.ConfigurableSiteMeshFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
in WEB-INF/sitemesh3.xml
add:
<sitemesh>
<mapping path="/*" decorator="/WEB-INF/decorator1.jsp"/>
</sitemesh>
in WEB-INF/decorator1.jsp
add:
<html>
<head>
...
</head>
<body>
<sitemesh:write property='body'/>
</body>
</html>
† put this below your Spring Security Filter Chain if using Spring Security.
In my case, I used this little tutorial to make it works.