title: dwrService.js NOT FOUND while running DWR with Spring MVC
body: <p>I have created a Spring DWR integration referring from <a href="http://krams915.blogspot.com/2011/01/spring-mvc-3-and-dwr-3-integration.html" rel="nofollow">here</a>.</p>
  
  <p>When I run the project I get a pop up "NOT FOUND" in the browser the response for dwrService.js is not found. Engine.js and util.js are loaded correctly.</p>
  
  <pre><code>Request: `http://localhost:8080/HelloWorldSpring3/dwr/interface/dwrService.js`
  Response: "404 Not Found"
  </code></pre>
  
  <p>The message in the console is </p>
  
  <pre><code>an 10, 2014 4:12:31 PM org.springframework.web.servlet.DispatcherServlet noHandlerFound
  WARNING: No mapping found for HTTP request with URI [/HelloWorldSpring3/forms/dwr/interface/dwrService.js] in DispatcherServlet with name 'dispatcher'
  Jan 10, 2014 4:14:24 PM org.springframework.web.servlet.DispatcherServlet noHandlerFound
  WARNING: No mapping found for HTTP request with URI [/HelloWorldSpring3/forms/dwr/dwr/interface/dwrService.js] in DispatcherServlet with name 'dispatcher'
  </code></pre>
  
  <p>Why the request for dwrService.js is going for the dispatcher servlet?</p>
  
  <p>Below are my config files and controller and jsp</p>
  
  <p>web.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd"&gt;
  
      &lt;display-name&gt;Comet&lt;/display-name&gt;
  
      &lt;servlet&gt;
        &lt;servlet-name&gt;dispatcher&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/applicationContext.xml&lt;/param-value&gt; 
          &lt;/init-param&gt; 
        &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
  
       &lt;!-- Mapping for DWR --&gt;
      &lt;servlet-mapping&gt;
        &lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt;
        &lt;url-pattern&gt;/forms/dwr/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;       
  
      &lt;!-- Mapping for MVC --&gt;
      &lt;servlet-mapping&gt;
        &lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt;
        &lt;url-pattern&gt;/forms/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;listener&gt;
          &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
      &lt;/listener&gt;
  
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;    
  &lt;/web-app&gt;
  </code></pre>
  
  <p>dwr-Context.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xmlns:context="http://www.springframework.org/schema/context"
      xmlns:p="http://www.springframework.org/schema/p" 
      xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"
      xsi:schemaLocation="
          http://www.springframework.org/schema/beans 
          http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
          http://www.directwebremoting.org/schema/spring-dwr
          http://www.directwebremoting.org/schema/spring-dwr-3.0.xsd"&gt;
  
      &lt;dwr:annotation-config /&gt;
  
      &lt;dwr:annotation-scan base-package="net.roseindia.controllers" scanDataTransferObject="true" scanRemoteProxy="true" /&gt;
  
      &lt;dwr:url-mapping /&gt;
  
      &lt;dwr:controller id="dwrController" debug="true"&gt;
      &lt;dwr:config-param name="activeReverseAjaxEnabled" value="true"/&gt;
      &lt;/dwr:controller&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>applicationContext.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xmlns:context="http://www.springframework.org/schema/context"
      xmlns:mvc="http://www.springframework.org/schema/mvc"
      xsi:schemaLocation="http://www.springframework.org/schema/beans 
              http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
              http://www.springframework.org/schema/context
              http://www.springframework.org/schema/context/spring-context-3.0.xsd
              http://www.springframework.org/schema/mvc 
              http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"&gt;
  
  
      &lt;context:annotation-config /&gt;
  
      &lt;context:component-scan base-package="net.roseindia.controllers" /&gt;
  
      &lt;mvc:annotation-driven /&gt; 
  
      &lt;bean class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter" /&gt;
  
      &lt;import resource="file:**/WebContent/WEB-INF/dwr-context.xml" /&gt;
  
      &lt;bean id="viewResolver"
          class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
  
          &lt;property name="prefix"&gt;
              &lt;value&gt;/WEB-INF/views/&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;/beans&gt;
  </code></pre>
  
  <p>JSP</p>
  
  <pre><code>&lt;%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %&gt;
  &lt;%@ page language="java" contentType="text/html; charset=UTF-8"
      pageEncoding="UTF-8"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
      &lt;title&gt;Spring MVC - DWR Integration Tutorial&lt;/title&gt;
      &lt;script type='text/javascript' src="${pageContext.request.contextPath}/dwr/engine.js"&gt;&lt;/script&gt;
      &lt;script type='text/javascript' src="${pageContext.request.contextPath}/dwr/util.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="${pageContext.request.contextPath}/dwr/interface/dwrService.js"&gt;&lt;/script&gt;
  
  
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;h3&gt;Spring MVC - DWR Integration Tutorial&lt;/h3&gt;
  &lt;h4&gt;AJAX version&lt;/h4&gt;
  
  &lt;script type="text/javascript"&gt;
      // Retrieves the matching value
      // Delegates to the dwrService
      function add() {
          // Retrieve value of text inputs
          var operand1 = dwr.util.getValue("inputNumber1");
          var operand2 = dwr.util.getValue("inputNumber2");
  
          // Pass two numbers, a callback function, and error function
          dwrService.add(operand1, operand2, {
              callback : handleAddSuccess,
              errorHandler : handleAddError
          });
      }
  
      // data contains the returned value
      function handleAddSuccess(data) {
          // Assigns data to result id
          dwr.util.setValue("sum", data);
      }
  
      function handleAddError() {
          // Show a popup message
          alert("We can't add those values!");
      }
  &lt;/script&gt;
  
  Demo 1
  &lt;div style="border: 1px solid #ccc; width: 250px;"&gt;
      Add Two Numbers: &lt;br/&gt;
      &lt;input id="inputNumber1" type="text" size="5"&gt; +
      &lt;input id="inputNumber2" type="text" size="5"&gt;
      &lt;input type="submit" value="Add" onclick="add()" /&gt; &lt;br/&gt;
      Sum: &lt;span id="sum"&gt;(Result will be shown here)&lt;/span&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>What am i doing wrong here?</p>