title: spring - jstl - Error 404 - The requested resource is not available
body: <p>When I want to access on my website, I've the following error :</p>
  
  <pre><code>The requested resource is not available.
  </code></pre>
  
  <p>I noticed that the problem is in the mvc-dispatcher-servlet.xml file on the line <code>&lt;mvc:resources mapping="/resources/**" location="../../resources/normalMode/"/&gt;</code> but I don't know why ? </p>
  
  <p>Do you have any solutions ? </p>
  
  <p>My project structure :</p>
  
  <pre><code>- src
    - main
      - java
        - com
          - myblog
            - controller
               -//all java files as controller
      - resources
         - normalMode
            - css
               - header.css
      - webapp
         - /WEB-INF
           - /pages 
             - mvc-dispatcher.xml
             - web.xml
  </code></pre>
  
  <p>mvc-dispatcher-servlet.xml</p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans" 
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:mvc="http://www.springframework.org/schema/mvc"
         xmlns:context="http://www.springframework.org/schema/context"
         xsi:schemaLocation="http://www.springframework.org/schema/beans
                             http://www.springframework.org/schema/beans/spring-beans.xsd 
                             http://www.springframework.org/schema/mvc
                             http://www.springframework.org/schema/mvc/spring-mvc.xsd
                             http://www.springframework.org/schema/context
                             http://www.springframework.org/schema/context/spring-context.xsd"&gt;
  
    &lt;context:component-scan base-package="com.myblog.controller" /&gt;
  
    &lt;bean id="viewResolver"
          class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
  
      &lt;property value="org.springframework.web.servlet.view.JstlView"
                name="viewClass" /&gt;
  
      &lt;property name="prefix"&gt;
        &lt;value&gt;/WEB-INF/pages/&lt;/value&gt;
      &lt;/property&gt;
  
      &lt;property name="suffix"&gt;
        &lt;value&gt;.jsp&lt;/value&gt;
      &lt;/property&gt;
    &lt;/bean&gt;
  
    &lt;mvc:resources mapping="/resources/**" location="../../resources/normalMode/"/&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>web.xml</p>
  
  <pre><code>&lt;!DOCTYPE web-app PUBLIC
     "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
     "http://java.sun.com/dtd/web-app_2_3.dtd" &gt;
  
    &lt;web-app&gt;
       &lt;display-name&gt;Archetype Created Web Application&lt;/display-name&gt;
  
       &lt;servlet&gt;
          &lt;servlet-name&gt;mvc-dispatcher&lt;/servlet-name&gt;
          &lt;servlet-class&gt;
             org.springframework.web.servlet.DispatcherServlet
          &lt;/servlet-class&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
       &lt;/servlet&gt;
  
       &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;mvc-dispatcher&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/&lt;/url-pattern&gt;
       &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>IndexController.java</p>
  
  <pre><code>package com.myblog.controller;
  
  import org.springframework.stereotype.Controller;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  import org.springframework.web.servlet.ModelAndView;
  
  @Controller
  @RequestMapping(value={"","/","home"})
  public class IndexController {
  
      @RequestMapping(method=RequestMethod.GET)
      public ModelAndView init(){
           return new ModelAndView("index");
      }
  }
  </code></pre>