title: Using Spring, mapping to root in web.xml, static resources aren't found
body: <p>What I'm trying to do is map requests to the servlet root (correct terminology?).  I'm at the point where URLs are mapped to correct view but all the static content - css, javascript, images - that is part of the page cannot be found.</p>
  
  <p>So in my web.xml my servlet tag looks like this</p>
  
  <pre><code>&lt;servlet-mapping&gt;
      &lt;servlet-name&gt;springapp&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>My controller looks something like this:</p>
  
  <pre><code>@RequestMapping("/shop")
  public class TheShopController extends MyBaseController {
  
      public static String VIEW = "Tile.Shop";
  
      @Override
      @RequestMapping(method = RequestMethod.GET)
      protected ModelAndView processRequest(HttpServletRequest req, HttpServletResponse resp) {
          ModelAndView mav = new ModelAndView(VIEW);
          return mav;
      }
  
  }
  </code></pre>
  
  <p>MyBaseController is very simple.  It looks like this:</p>
  
  <pre><code>public abstract class MyBaseController extends AbstractController {
  
      protected Logger log = Logger.getLogger(getClass());
  
      @Override
      protected ModelAndView handleRequestInternal(HttpServletRequest req, HttpServletResponse resp) 
          throws Exception {
  
          ModelAndView mav = processRequest(req, resp);
          return mav;
      }
  
      protected abstract ModelAndView processRequest(HttpServletRequest req, HttpServletResponse resp);
  }
  </code></pre>
  
  <p>I'm using Tiles in my view layer. My configuration is as follows:</p>
  
  <p>
    
   </p>
  
  <p>
    
     
      /WEB-INF/tiles-defs.xml
     
    
   </p>
  
  <p>As I mentioned, the views are found but the static resources that are a port of the page can't be found.  Here is some typical logging out put:</p>
  
  <blockquote>
    <p>2010-01-24 17:25:01,777 DEBUG [http-8080-7] servlet.DispatcherServlet
    (DispatcherServlet.java:690) - DispatcherServlet with name 'springapp'
    processing GET request for [/springapp/static/css/account.css]
    2010-01-24 17:25:01,778 WARN  [http-8080-4] servlet.DispatcherServlet
    (DispatcherServlet.java:962) - No mapping found for HTTP request with
    URI [/springapp/static/css/shop.css] in DispatcherServlet with name
    'springapp' 2010-01-24 17:25:01,778 DEBUG [http-8080-6]
    servlet.FrameworkServlet (FrameworkServlet.java:677) - Successfully
    completed request 2010-01-24 17:25:01,778 WARN  [http-8080-5]
    servlet.DispatcherServlet (DispatcherServlet.java:962) - No mapping
    found for HTTP request with URI [/springapp/static/css/offers.css] in
    DispatcherServlet with name 'springapp' 2010-01-24 17:25:01,778 WARN 
    [http-8080-3] servlet.DispatcherServlet (DispatcherServlet.java:962) -
    No mapping found for HTTP request with URI
    [/springapp/static/css/scrollable-buttons.css] in DispatcherServlet
    with name 'springapp'</p>
  </blockquote>
  
  <p>Going to 
  <a href="http://localhost:8080/springapp/shop" rel="noreferrer">http://localhost:8080/springapp/shop</a> works fine but the css and images are missing.</p>
  
  <p>I think that using Tiles is somehow complicating things but I"m reluctant to get rid of it.  I'm wondering if I need to adjust my view resolution configuration needs to be tweeked somehow?  Chaining view resolvers maybe?  I'm just not that experienced in doing that.  </p>