Results 1 to 2 of 2

Thread: Sitemesh works with *.do but not /spring/*

  1. #1

    Default 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. #2
    Join Date
    Jan 2007
    Location
    Orlando, FL USA
    Posts
    84

    Default

    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.
    http://www.jroller.com/thebugslayer - notes on java, scala and other development stuff.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •