title: Spring 4 MVC , WARNING: No mapping found for HTTP request with URI in DispatcherServlet with name [...] & HTTP 404 Error
body: <p>My project suddenly broke ,dispatcher servlet is unable to forward to my view,  I started initially getting </p>
  
  <p>WARNING: No mapping found for HTTP request with URI [/thedallasapp_poc/] in Disp
  atcherServlet with name 'mvc_dispatcher' &amp; 404 Error in the browser.</p>
  
  <p>Than after changing settings I got no error.warning in the logs but I got just a 404 Error. </p>
  
  <p><strong>Here is my project setup:</strong></p>
  
  <p>Java:
  1.6</p>
  
  <p>Web Framework:</p>
  
  <p>•   Spring 4.0.0.RELEASE (MVC &amp; other packages)
  •    Spring security 3.2.4.RELEASE</p>
  
  <p>ORM:</p>
  
  <p>•   hibernate 4.1.5.Final
  Clean,Build,Compile,Package:
  •   Maven</p>
  
  <p>Database:</p>
  
  <p>•   Postgresql</p>
  
  <p>Web Server:
  Apache Tomcat 7.0</p>
  
  <p><strong>Here is my pom.xml:</strong></p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.hitachi&lt;/groupId&gt;
      &lt;artifactId&gt;thedallasapp_poc_test&lt;/artifactId&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;thedallasapp_poc_test&lt;/name&gt;
      &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
  
      &lt;!-- properties --&gt;
      &lt;properties&gt;
          &lt;app.name&gt;thedallassapp_poc&lt;/app.name&gt;
          &lt;tomcat.version&gt;6.0.26&lt;/tomcat.version&gt;
          &lt;spring.version&gt;4.0.0.RELEASE&lt;/spring.version&gt;
          &lt;hibernate.version&gt;4.1.5.Final&lt;/hibernate.version&gt;
          &lt;spring.security.version&gt;3.2.4.RELEASE&lt;/spring.security.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
  
          &lt;!-- jee --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax&lt;/groupId&gt;
              &lt;artifactId&gt;javaee-api&lt;/artifactId&gt;
              &lt;version&gt;7.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax&lt;/groupId&gt;
              &lt;artifactId&gt;javaee-web-api&lt;/artifactId&gt;
              &lt;version&gt;7.0&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- dependencies spring 4 --&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-tx&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
              &lt;artifactId&gt;spring-security-config&lt;/artifactId&gt;
              &lt;version&gt;${spring.security.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
              &lt;artifactId&gt;spring-security-web&lt;/artifactId&gt;
              &lt;version&gt;${spring.security.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
              &lt;artifactId&gt;spring-security-taglibs&lt;/artifactId&gt;
              &lt;version&gt;${spring.security.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;commons-logging&lt;/groupId&gt;
              &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
              &lt;version&gt;1.1.1&lt;/version&gt;
          &lt;/dependency&gt;
  
  
          &lt;!-- Spring 4 dependencies END --&gt;
  
          &lt;!-- jdbc &amp; database START --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;postgresql&lt;/groupId&gt;
              &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
              &lt;version&gt;9.1-901-1.jdbc4&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- connection pool --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.tomcat&lt;/groupId&gt;
              &lt;artifactId&gt;tomcat-dbcp&lt;/artifactId&gt;
              &lt;version&gt;7.0.52&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate.javax.persistence&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-jpa-2.0-api&lt;/artifactId&gt;
              &lt;version&gt;1.0.1.Final&lt;/version&gt;
          &lt;/dependency&gt;
  
  
          &lt;!-- jdbc &amp; database END --&gt;
  
          &lt;!-- hibernate START --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
              &lt;version&gt;${hibernate.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.javassist&lt;/groupId&gt;
              &lt;artifactId&gt;javassist&lt;/artifactId&gt;
              &lt;version&gt;3.18.1-GA&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- hibernate END --&gt;
  
          &lt;!-- junit --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;3.8.1&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;!-- jstl --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;jstl&lt;/artifactId&gt;
              &lt;version&gt;1.1.1&lt;/version&gt;
  
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;taglibs&lt;/groupId&gt;
              &lt;artifactId&gt;standard&lt;/artifactId&gt;
  
              &lt;version&gt;1.1.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;taglibs&lt;/groupId&gt;
              &lt;artifactId&gt;c&lt;/artifactId&gt;
              &lt;version&gt;1.1.1&lt;/version&gt;
  
              &lt;type&gt;tld&lt;/type&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;taglibs&lt;/groupId&gt;
              &lt;artifactId&gt;fmt&lt;/artifactId&gt;
              &lt;version&gt;1.1.1&lt;/version&gt;
  
              &lt;type&gt;tld&lt;/type&gt;
          &lt;/dependency&gt;
  
          &lt;!-- webapp-runner --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.github.jsimone&lt;/groupId&gt;
              &lt;artifactId&gt;webapp-runner&lt;/artifactId&gt;
              &lt;version&gt;7.0.40.0&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
      &lt;!-- build --&gt;
      &lt;build&gt;
          &lt;finalName&gt;thedallasapp_poc&lt;/finalName&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.tomcat.maven&lt;/groupId&gt;
                  &lt;artifactId&gt;tomcat7-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.2&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;warFile&gt;target/thedallasapp_poc.war&lt;/warFile&gt;
                      &lt;url&gt;http://localhost:8080/manager/text&lt;/url&gt;
                      &lt;update&gt;true&lt;/update&gt;
                      &lt;server&gt;MyTomcat&lt;/server&gt;
                      &lt;path&gt;/thedallasapp_poc&lt;/path&gt;
                      &lt;username&gt;tomcat&lt;/username&gt;
                      &lt;password&gt;password6678&lt;/password&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.0&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;!-- &lt;packagingExcludes&gt;WEB-INF/lib/*.jar&lt;/packagingExcludes&gt; --&gt;
                      &lt;packagingExcludes&gt;WEB-INF/lib/tomcat*&lt;/packagingExcludes&gt;
                      &lt;source&gt;1.6&lt;/source&gt;
                      &lt;target&gt;1.6&lt;/target&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;phase&gt;package&lt;/phase&gt;
                              &lt;goals&gt;
                                  &lt;goal&gt;copy&lt;/goal&gt;
                              &lt;/goals&gt;
                              &lt;configuration&gt;
                                  &lt;artifactItems&gt;
                                      &lt;artifactItem&gt;
                                          &lt;groupId&gt;com.github.jsimone&lt;/groupId&gt;
                                          &lt;artifactId&gt;webapp-runner&lt;/artifactId&gt;
                                          &lt;version&gt;7.0.40.0&lt;/version&gt;
                                          &lt;destFileName&gt;webapp-runner.jar&lt;/destFileName&gt;
                                      &lt;/artifactItem&gt;
                                  &lt;/artifactItems&gt;
                              &lt;/configuration&gt;
                          &lt;/execution&gt;
                      &lt;/executions&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p><strong>web.xml:</strong></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" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
      version="3.0"&gt;
  
      &lt;display-name&gt;Toyota Relocation App&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;!-- load spring security --&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;/WEB-INF/mvc_dispatcher-servlet.xml,/WEB-INF/security.xml&lt;/param-value&gt;
      &lt;/context-param&gt;
  
      &lt;listener&gt;
          &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
      &lt;/listener&gt;
  
      &lt;!-- spring security --&gt;
      &lt;filter&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt;
      &lt;/filter&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>Eclipse Project structure:</p>
  
  <p><img src="https://i.stack.imgur.com/TB6MQ.png" alt="enter image description here"></p>
  
  <p><strong>mvc-dispatcher-servlet:</strong></p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:context="http://www.springframework.org/schema/context"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
      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/tx 
          http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
          http://www.springframework.org/schema/mvc 
          http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"&gt;
  
  
      &lt;mvc:annotation-driven /&gt;
      &lt;!-- scan at "com.hitachi.thedallasapp_poc" for spring annotated components 
          &amp; register in spring container --&gt;
      &lt;context:annotation-config /&gt;
  
      &lt;!-- &lt;mvc:default-servlet-handler/&gt;--&gt;
  
      &lt;context:component-scan base-package="com.hitachi.thedallasapp_poc.Category" /&gt;
      &lt;context:component-scan base-package="com.hitachi.thedallasapp_poc.location" /&gt;
      &lt;context:component-scan base-package="com.hitachi.thedallasapp_poc.messaging" /&gt;
      &lt;context:component-scan base-package="com.hitachi.thedallasapp_poc.userprofile" /&gt;
      &lt;context:component-scan base-package="com.hitachi.thedallasapp_poc.test" /&gt;
  
      &lt;!-- the mvc resources tag that handles static content requests under resources 
          path --&gt;
      &lt;mvc:resources mapping="/resources/**" location="/resources/" /&gt;
  
      &lt;!-- ViewResolver --&gt;
  
      &lt;bean
          class="org.springframework.web.servlet.view.InternalResourceViewResolver"&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;!-- datasource &amp; hibernate configs --&gt;
  
      &lt;bean id="myProperties"
          class="org.springframework.beans.factory.config.PropertiesFactoryBean"&gt;
          &lt;property name="locations"&gt;
              &lt;list&gt;
                  &lt;value&gt;classpath*:db-dev.properties&lt;/value&gt;
              &lt;/list&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;!-- local datasource --&gt;
  
      &lt;bean id="postgresqlDataSource" destroy-method="close"
          class="org.apache.tomcat.dbcp.dbcp.BasicDataSource"&gt;
          &lt;property name="driverClassName" value="org.postgresql.Driver" /&gt;
          &lt;property name="url"
              value="jdbc:postgresql://localhost:5432/postgres?createDatabaseIfNotExist=true" /&gt;
          &lt;property name="username" value="postgres" /&gt;
          &lt;property name="password" value="heroku6678" /&gt;
      &lt;/bean&gt;
  
      &lt;!-- hibernate sessionFactoty via properties --&gt;
      &lt;bean id="sessionFactory"
          class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"&gt;
  
          &lt;property name="dataSource" ref="postgresqlDataSource" /&gt;
  
              &lt;!-- annotated classes --&gt;
          &lt;property name="annotatedClasses"&gt;
              &lt;list&gt;
                  &lt;value&gt;com.hitachi.thedallasapp_poc.userprofile.UserProfile&lt;/value&gt;
                  &lt;value&gt;com.hitachi.thedallasapp_poc.userprofile.UserConnection&lt;/value&gt;
                  &lt;value&gt;com.hitachi.thedallasapp_poc.Category.Categories&lt;/value&gt;
                  &lt;value&gt;com.hitachi.thedallasapp_poc.location.Location&lt;/value&gt;
                  &lt;value&gt;com.hitachi.thedallasapp_poc.location.FavoriteLocation&lt;/value&gt;
                  &lt;value&gt;com.hitachi.thedallasapp_poc.messaging.Messages&lt;/value&gt;
              &lt;/list&gt;
          &lt;/property&gt;
           &lt;property name="hibernateProperties"&gt;
              &lt;props&gt;
                  &lt;prop key="hibernate.hbm2ddl.auto"&gt;create&lt;/prop&gt;
                  &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.PostgreSQLDialect&lt;/prop&gt;
                  &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
                  &lt;prop key="hibernate.temp.use_jdbc_metadata_defaults"&gt;false&lt;/prop&gt; 
              &lt;/props&gt;
          &lt;/property&gt;
  
      &lt;/bean&gt;
  
      &lt;!-- transaction management --&gt;
      &lt;bean id="txManager"
          class="org.springframework.orm.hibernate4.HibernateTransactionManager"&gt;
          &lt;property name="sessionFactory" ref="sessionFactory" /&gt;
          &lt;property name="dataSource" ref="postgresqlDataSource" /&gt;
      &lt;/bean&gt;
  
  
      &lt;bean id="persistenceExceptionTranslationPostProcessor"
          class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" /&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p><strong>security.xml:</strong></p>
  
  <pre><code>&lt;beans:beans xmlns="http://www.springframework.org/schema/security"
      xmlns:beans="http://www.springframework.org/schema/beans" 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-3.0.xsd
             http://www.springframework.org/schema/security
             http://www.springframework.org/schema/security/spring-security-3.2.xsd"&gt;
  
      &lt;!-- spring security should ignore "/" &amp; "/resources/**" paths --&gt;
      &lt;http pattern="/" security="none" auto-config="true"
          use-expressions="true" /&gt;
      &lt;http pattern="/login" security="none" auto-config="true"
          use-expressions="true" /&gt;
      &lt;http pattern="/resources/**" security="none" auto-config="true"
          use-expressions="true" /&gt;
  
      &lt;!-- custom bean used to override spring security page redirection after 
          successful authentication --&gt;
      &lt;beans:bean id="myAuthSuccessHandler"
          class="com.hitachi.thedallasapp_poc.security.MyAuthSuccessHandler" /&gt;
  
  
      &lt;!-- spring security configuration intercept-url &amp; login form --&gt;
      &lt;http auto-config="true" use-expressions="true"&gt;
          &lt;intercept-url pattern="/auth/**" access="hasRole('ROLE_USER')" /&gt;
  
          &lt;form-login login-page="/login" authentication-failure-url="/login?error"
              username-parameter="emailInputField" password-parameter="pinInputField"
              default-target-url="/auth/welcome" always-use-default-target="true"
              authentication-success-handler-ref="myAuthSuccessHandler" /&gt;
          &lt;!-- keep logged in session for 3 days or 259200 secs --&gt;
          &lt;remember-me key="uniqueAndSecret1984"
              token-validity-seconds="60" /&gt;
  
          &lt;logout logout-url="/logout" logout-success-url="/login?logout=1"
              delete-cookies="JSESSIONID" invalidate-session="true" /&gt;
  
      &lt;/http&gt;
  
      &lt;!-- user accounts --&gt;
      &lt;authentication-manager&gt;
          &lt;authentication-provider&gt;
              &lt;user-service&gt;
                  &lt;user name="naim@test.com" password="12345" authorities="ROLE_USER" /&gt;
              &lt;/user-service&gt;
          &lt;/authentication-provider&gt;
      &lt;/authentication-manager&gt;
  
  &lt;/beans:beans&gt;
  </code></pre>
  
  <p><strong>Class HomeController:</strong> </p>
  
  <pre><code>package com.hitachi.thedallasapp_poc;
  
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  import javax.servlet.http.HttpSession;
  
  import org.springframework.security.authentication.RememberMeAuthenticationToken;
  import org.springframework.security.core.Authentication;
  import org.springframework.security.core.context.SecurityContextHolder;
  import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler;
  import org.springframework.stereotype.Controller;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestParam;
  import org.springframework.web.context.ContextLoaderListener;
  import org.springframework.web.servlet.ModelAndView;
  
  @Controller
  public class HomeControler {
  
      public HomeControler() {
          super();
          // TODO Auto-generated constructor stub
      }
  
      /* serves the login landing/home page view */
      @RequestMapping(value="/")
      public ModelAndView serveLanding(HttpSession session) {
  
  
  
          ModelAndView model = new ModelAndView();
          model.setViewName("login");
          Authentication auth = SecurityContextHolder.getContext().getAuthentication();
          //check if isRememberMeAuthenticated cookie is true from previous login 
          System.out.println("Class HomeControler, String serveLanding(), isRememberMeAuthenticated():"+isRememberMeAuthenticated());
          if (isRememberMeAuthenticated()!=false &amp;&amp; auth.isAuthenticated()!=false)    
          {
              session.setAttribute("isRememberMeAuthenticated", true);
  
          }
  
          return model;
      }
  
      /* process login request from login view */
      @RequestMapping(value = "/login**")
      public ModelAndView processLogin(String error,@RequestParam(value = "logout", required = false) String logout)
      {
          System.out.println("Class HomeControler,  processLogin()");
          ModelAndView model = new ModelAndView();
  
           //non test code
  
          if (error != null) {
              System.out.println("Class HomeControler,  processLogin(), error ");
              model.addObject("error", "Invalid username and password!");
  
          }
              if (logout != null) {
                  System.out.println("Class HomeControler,  processLogin(), logout ");
                  model.addObject("msg", "You've been logged out successfully.");
  
              }
  
              model.setViewName("login");
  
  
              return model;
  
      }
  
  
      /* serves the login landing/home page view */
      @RequestMapping(value="/auth/welcome**")
      public ModelAndView welcome(HttpSession session) {
  
          System.out.println("Class HomeControler, String welcome()");
  
          ModelAndView model = new ModelAndView();
  
          Authentication auth = SecurityContextHolder.getContext().getAuthentication();
          //after authentication check isRememberMeAuthenticated cookie is true
          System.out.println("Class HomeControler, String welcome(), isRememberMeAuthenticated():"+isRememberMeAuthenticated());
  
                 if (isRememberMeAuthenticated()!=false &amp;&amp; auth.isAuthenticated()!=false) 
                  {
  
                      session.setAttribute("isRememberMeAuthenticated", true);
  
                  }
          //get logged in username
  
          String name = auth.getName();
          model.addObject("loggedInUserName", name);
          model.setViewName("/auth/appView");
  
          return model;
      }
  
  
      /* serves the login landing/home page view */
      @RequestMapping(value="/logout")
      public  ModelAndView logoutTheUserAndInvalidateSession(HttpSession session, HttpServletRequest request, HttpServletResponse response) {
  
          ModelAndView model = new ModelAndView();
          //logout via spring security 
           Authentication auth = SecurityContextHolder.getContext().getAuthentication(); 
              SecurityContextLogoutHandler ctxLogOut = new SecurityContextLogoutHandler();
                  ctxLogOut.logout(request, response, auth); 
              //invalidate session just to make sure 
                  session = request.getSession(false);
                  if (session != null) {
                      session.invalidate();
                  }
  
                  model.addObject("logout","1");
                  model.setViewName("login");
  
      return model;
      }
  
  
      /**
       * Check if user is login by remember me cookie, refer
       * org.springframework.security.authentication.AuthenticationTrustResolverImpl
       */
      private boolean isRememberMeAuthenticated() {
  
          Authentication authentication = 
                      SecurityContextHolder.getContext().getAuthentication();
          if (authentication == null) {
              return false;
          }
  
          return RememberMeAuthenticationToken.class.isAssignableFrom(authentication.getClass());
      }
  
      }//end class HomeControler
  </code></pre>
  
  <p><strong>login View:</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Toyota Relocation App&lt;/title&gt;
  &lt;meta name="viewport"
      content="width=device-width, initial-scale=1, user-scalable=no"&gt;
  &lt;%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%&gt;
  &lt;%@ taglib prefix="sec"
      uri="http://www.springframework.org/security/tags"%&gt;
  &lt;!-- jquery styles &amp; scripts --&gt;
  &lt;script
      src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
      $(document).bind("mobileinit", function() {
          $.mobile.ajaxEnabled = false;
      });
  &lt;/script&gt;
  &lt;script&gt;
      $(document).ready(function() {
  
          // if error has data then make div visible
          &lt;c:if test="${not empty error}"&gt;
          if ($('.error_div').length &gt; 0) {
              console.log("found .error_div");
              $('.error_div').show();
          }
          &lt;/c:if&gt;
          // if msg has data then make div visible
          &lt;c:if test="${not empty msg}"&gt;
          if ($('.msg_div').length &gt; 0) {
              console.log("found .msg_div");
              $('.msg_div').show();
          }
          &lt;/c:if&gt;
      });
  &lt;/script&gt;
  &lt;link rel="stylesheet"
      href="//ajax.googleapis.com/ajax/libs/jquerymobile/1.4.2/jquery.mobile.min.css" /&gt;
  &lt;script
      src="//ajax.googleapis.com/ajax/libs/jquerymobile/1.4.2/jquery.mobile.min.js"&gt;&lt;/script&gt;
  &lt;!--  http://fortawesome.com --&gt;
  &lt;link
      href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css"
      rel="stylesheet"&gt;
  &lt;!-- custom stylesd &amp; scripts --&gt;
  &lt;link rel="stylesheet" href="resources/css/home.css" /&gt;
  &lt;script type="text/javascript" src="resources/js/home.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;!--  
  &lt;sec:authorize access="hasRole('ROLE_USER')"&gt;
  &lt;script&gt;
  console.log("hasRole('ROLE_USER')");
  $.post( "./auth/app" );
  &lt;/script&gt;
  &lt;/sec:authorize&gt;
  --&gt;
      &lt;div class="wrapper"&gt;
  
          &lt;!-- 
          &lt;div data-role="header" data-position="fixed"&gt;
              &lt;div class="myheader"&gt;HEADER&lt;/div&gt;
          &lt;/div&gt;
          --&gt;
  
          &lt;div data-role="content"&gt;
  
              &lt;div class="mycontent"&gt;
                  &lt;div id="logo_div"&gt;
                      &lt;img src="resources/images/01_toyota_logo_small.png"&gt;
                  &lt;/div&gt;
                  &lt;div class="login_form_wrapper"&gt;
                      &lt;!--  login error &amp; msg jstl --&gt;
                      &lt;div class="error_div" style="display: none;"&gt;
                          &lt;p class="error_text"&gt;${error}&lt;/p&gt;
                      &lt;/div&gt;
                      &lt;div class="msg_div" style="display: none;"&gt;
                          &lt;p class="msg_text"&gt;${msg}&lt;/p&gt;
                      &lt;/div&gt;
                      &lt;!-- spring security form --&gt;
                      &lt;form name='loginForm'
                          action="&lt;c:url value='/j_spring_security_check' /&gt;" method='POST'&gt;
  
                          &lt;ul class="mylistview" data-role="listview"&gt;
                              &lt;li&gt;
                                  &lt;div&gt;
                                      &lt;img id="email_input_icon"
                                          src="resources/images/01_login_email_icon_small.png"&gt;
                                  &lt;/div&gt;
                                  &lt;div id="email_input"&gt;
                                      &lt;input name="emailInputField" " id="email_input_field"
                                          type="email" data-role="none" /&gt;
                                  &lt;/div&gt;
                              &lt;/li&gt;
                              &lt;li&gt;
                                  &lt;div&gt;
                                      &lt;img id="pin_input_icon"
                                          src="resources/images/01_login_password_icon_small.png"&gt;
                                  &lt;/div&gt;
                                  &lt;div id="pin_input"&gt;
                                      &lt;input name="pinInputField" id="pin_input_field"
                                          type="password" data-role="none" /&gt;
                                  &lt;/div&gt;
                              &lt;/li&gt;
                              &lt;li&gt;
  
                                  &lt;div id="login_button"&gt;
                                      &lt;button id="login" class="button" type="submit"&gt;LOGIN&lt;/button&gt;
                                  &lt;/div&gt;
                                  &lt;div id="remember"&gt;
                                      &lt;label class="checkboxLabel" data-role="none"
                                          style="float: left"&gt;
                                          &lt;p&gt;Remember Me&lt;/p&gt;
                                      &lt;/label&gt; &lt;input data-role="none" type='checkbox'
                                          name='_spring_security_remember_me'
                                          id="_spring_security_remember_me" value="true" /&gt;
                                  &lt;/div&gt;
                              &lt;/li&gt;
                          &lt;/ul&gt;
  
                      &lt;/form&gt;
                  &lt;/div&gt;
  
                  &lt;div class="or_divider"&gt;
                      &lt;img src="resources/images/01_login_or_option_small.png"&gt;
                  &lt;/div&gt;
  
                  &lt;div class="options_menu"&gt;
  
                      &lt;ul class="mylistview2" data-role="listview"&gt;
                          &lt;li&gt;
                              &lt;div id="login_account_no_words_icon"&gt;
                                  &lt;img src="resources/images/01_login_account_no_words_small.png"&gt;
                              &lt;/div&gt;
                              &lt;div id="login_guest_no_words_icon"&gt;
                                  &lt;img src="resources/images/01_login_guest_no_words_small.png"&gt;
                              &lt;/div&gt;
                          &lt;/li&gt;
                          &lt;li&gt;
                              &lt;div id="create_an_account"&gt;
                                  &lt;P&gt;Create An Account&lt;/P&gt;
                              &lt;/div&gt;
                              &lt;div id="continue_as_guest"&gt;
                                  &lt;P&gt;Continue As Guest&lt;/P&gt;
                              &lt;/div&gt;
                          &lt;/li&gt;
  
                      &lt;/ul&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
  
          &lt;/div&gt;
          &lt;!-- 
          &lt;div data-role="footer"&gt;
              &lt;div class="myfooter"&gt;FOOTER&lt;/div&gt;
          &lt;/div&gt;
          --&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Deployment via Eclipse:</strong></p>
  
  <p>Than I deployed to Tomcat via Eclipse by, Right clicking my project, selecting Run As, choose Tomcatv7.0 , selecting Finish...</p>
  
  <p><strong>Result:</strong> </p>
  
  <p>The App launches with no errors/exceptions in the logs, but i get 404 error in the browser &amp; this warning:</p>
  
  <p>WARNING: No mapping found for HTTP request with URI [/thedallasapp_poc/] in Disp
  atcherServlet with name 'mvc_dispatcher'</p>
  
  <p><strong>Deployment via Maven:</strong></p>
  
  <p>Deploying using command "mvn tomcat7:deploy" or "mvn tomcat7:redeploy"</p>
  
  <p>Again, The App launches with no errors/exceptions in the logs, but i get 404 error in the browser &amp; this warning:</p>
  
  <p>WARNING: No mapping found for HTTP request with URI [/thedallasapp_poc/] in Disp
  atcherServlet with name 'mvc_dispatcher'</p>
  
  <p>Finally I changed the web.xml Dispatcher servlet-name mapping to "/thedallasapp_poc*" instead of "/":</p>
  
  <p><strong>web.xml snippet:</strong></p>
  
  <pre><code>&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;/thedallasapp_poc*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>Therefore I also changed HomeController from @RequestMapping(value="/") to @RequestMapping(value="/thedallasapp_poc")</p>
  
  <p>@Controller
  public class HomeControler {</p>
  
  <pre><code>public HomeControler() {
      super();
      // TODO Auto-generated constructor stub
  }
  
  /* serves the login landing/home page view */
  @RequestMapping(value="/thedallasapp_poc")
  public ModelAndView serveLanding(HttpSession session) {
  
  
  
      ModelAndView model = new ModelAndView();
      model.setViewName("login");
      Authentication auth = SecurityContextHolder.getContext().getAuthentication();
      //check if isRememberMeAuthenticated cookie is true from previous login 
      System.out.println("Class HomeControler, String serveLanding(), isRememberMeAuthenticated():"+isRememberMeAuthenticated());
      if (isRememberMeAuthenticated()!=false &amp;&amp; auth.isAuthenticated()!=false)    
      {
          session.setAttribute("isRememberMeAuthenticated", true);
  
      }
  
      return model;
  }
  </code></pre>
  
  <p>}//end HomeControler</p>
  
  <p>Than I rebuilt my project using Maven "mvn clean package" &amp; launched the project again.</p>
  
  <p>The result:
   I dont get anymore warnings, but I still get a 404 error in the browser , and actually I prefer "/" mapping for the DispatcherServlet mapping. </p>
  
  <p>Any well thought of suggestions/help well be extremely appreciated , as I'm on a deadline.</p>
  
  <p>Thanks</p>