Announcement Announcement Module
Collapse
No announcement yet.
SiteMesh + SpringMVC Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SiteMesh + SpringMVC

    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

  • #2
    Try:
    Code:
      <filter-mapping>
          <filter-name>sitemesh</filter-name>
          <url-pattern>*.jsp</url-pattern>
      </filter-mapping>
      <filter-mapping>
          <filter-name>sitemesh</filter-name>
          <url-pattern>*.htm</url-pattern>
      </filter-mapping>

    Comment

    Working...
    X