I have an application Web in which I am using SiteMesh and Spring
In the web.xml I have
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>
com.opensymphony.module.sitemesh.filter.PageFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
In the decorators.xml I have
<decorators >
<!-- Decorator for pages which need main -->
<decorator name="main"
page="/WEB-INF/view/jsp/decorators/main.jsp">
<pattern>home.jsp</pattern>
</decorator>
</decorators>
My URL-Mapping in servlet.xml uses *.htm, then when the Controller returns a ModelAndView would give the sensation of which SiteMesh this not taking part. In the name-servlet.xml I have
<!--Handler Mapping -->
<bean id="urlMapping"
class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="/viewCommand.htm">viewCommandForm</prop>
<prop key="/home.htm">homeController</prop>
</props>
</property>
</bean>
In the HomeController I have
public ModelAndView handleRequest(HttpServletRequest request,
HttpServletResponse response) throws Exception {
return new ModelAndView("home");
}
In the answer I do not obtain the decorated page, I suspect that the URL that returns the SpringMVC not this being captured by SiteMesh.
Thanks
Javier


Reply With Quote