Announcement Announcement Module
Collapse
No announcement yet.
Sitemesh works with *.do but not /spring/* Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sitemesh works with *.do but not /spring/*

    I can't get Sitemesh to apply a decorator when I declare in my web.xml

    Code:
      <servlet-mapping>
        <servlet-name>spring-web</servlet-name>
        <url-pattern>/spring/*</url-pattern>
      </servlet-mapping>

    but it works when I use

    Code:
      <servlet-mapping>
        <servlet-name>spring-web</servlet-name>
        <url-pattern>*.do</url-pattern>
      </servlet-mapping>


    Some of my decorators.xml patterns

    Code:
    		<pattern>/application/*</pattern>
    		<pattern>/application/list*</pattern>
    		<pattern>/application/*list*</pattern>
    		<pattern>/*/application/*list*</pattern>
    		<pattern>/**/*list*</pattern>
    		<pattern>/*/application/list*</pattern>
    		<pattern>/*/application/*list*</pattern>
    		<pattern>/*/application/*</pattern>
    Also, the same code without the initial / and also with /spring/...

    My web.xml (straight from appfuse)

    Code:
        <!-- Context Configuration locations for Spring XML files -->
        <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:/spring/*.xml</param-value>
        </context-param>
        <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>/*</url-pattern>
            <dispatcher>REQUEST</dispatcher>
            <dispatcher>FORWARD</dispatcher>
        </filter-mapping>
        <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>
    
      <servlet>
        <servlet-name>spring-web</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
          <param-name>contextConfigLocation</param-name>
          <param-value>classpath:/spring/*.xml</param-value>
        </init-param>
        <load-on-startup>2</load-on-startup>
      </servlet>
    
        <servlet-mapping>
            <servlet-name>spring-web</servlet-name>
            <url-pattern>/spring/*</url-pattern>
        </servlet-mapping>

  • #2
    Hi icetbr,

    It's likely that you don't have sitemesh config right. Double check the sitemesh.xml and it's decorator.xml file as they allow you to specify path to your view files. Also the way you declare Spring's ViewResolver can affect where you view files are located. Double check those settings.

    Comment

    Working...
    X