title: Spring MVC Error: org.springframework.web.servlet.DispatcherServlet noHandlerFound
body: <p>I have created a simple Spring MVC Project to display "Hello World" and it is working fine. Now, I want to add some css properties. I created a css folder inside WebContent and added a css file in it and added below line in my dispatcher servlet:</p>
  
  <pre><code>&lt;mvc:resources mapping="/css/**" location="/css/" /&gt;
  </code></pre>
  
  <p>Now I'm getting below errors on console:</p>
  
  <pre><code>org.springframework.web.servlet.DispatcherServlet noHandlerFound
  WARNING: No mapping found for HTTP request with URI [/SpringTest/] in DispatcherServlet with name 'spring'
  </code></pre>
  
  <p>This is my web.xml :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"&gt;
    &lt;display-name&gt;SpringGradle&lt;/display-name&gt;
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;spring&lt;/servlet-name&gt;
          &lt;servlet-class&gt;
              org.springframework.web.servlet.DispatcherServlet
          &lt;/servlet-class&gt;
          &lt;init-param&gt;
           &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
           &lt;param-value&gt;/WEB-INF/spring-servlet.xml&lt;/param-value&gt;         
         &lt;/init-param&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;spring&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/&lt;/url-pattern&gt;        
      &lt;/servlet-mapping&gt;  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>Here is my Dispatcher servlet:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      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.pawan.controller" /&gt;
      &lt;mvc:resources mapping="/css/**" location="/css/" /&gt;
  
      &lt;bean id="viewResolver"
          class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
          &lt;property name="prefix" value="/WEB-INF/jsp/" /&gt;
          &lt;property name="suffix" value=".jsp" /&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>And the JSP file:</p>
  
  <pre><code>&lt;%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%&gt;
  &lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
      pageEncoding="ISO-8859-1"%&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;spring:url value="/css/myStyleCss.css" var="myStyleCss" /&gt;
  &lt;link href="${myStyleCss}" rel="stylesheet" /&gt;
  
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  &lt;title&gt;Home&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
   &lt;h2 class="test"&gt;Welcome&lt;/h2&gt;&lt;br&gt;
  &lt;h3&gt;${message}&lt;/h3&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Controller Class:</p>
  
  <pre><code>package com.pawan.controller;
  
  import org.springframework.stereotype.Controller;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.servlet.ModelAndView;
  
  @Controller
  public class LoginController {
  
      @RequestMapping("/")
      public ModelAndView login() {
  
          ModelAndView model = new ModelAndView("home");
          model.addObject("message", "Hello !!! First Spring Program");
          return model;
      }
  }
  </code></pre>
  
  <p>Please help me in clearing my concepts.</p>