title: Why does my Spring web project not load the correct page on startup?
body: <p>Title says it all really. I have a small Spring web project that, on launch, should open <code>redirect.jsp</code> in my browser. This should send me through a default controller to <code>home.jsp</code>. The problem is, it doesn't. Instead it automatically opens some default index page in my browser. The index page I am shown does not exist in my project, has the title "Starting Page" and only shows a header with "Hello World". Strangely enough, the url in my browser is just <code>localhost:port/projectrootfolder</code> and not <code>localhost:port/projectrootfolder/home.htm</code> or something similar.</p>
  
  <p>My project structure  </p>
  
  <pre><code>root  
  |...  
  |Web pages  
  | |WEB-INF  
  | | |jsp
  | | | |home.jsp    
  | |dispatcher-servlet.xml  
  | |web.xml  
  |redirect.jsp
  </code></pre>
  
  <p>My dispatcher-servlet.xml    </p>
  
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8' ?&gt;
  &lt;!-- was: &lt;?xml version="1.0" encoding="UTF-8"?&gt; --&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns:p="http://www.springframework.org/schema/p"
             xmlns:aop="http://www.springframework.org/schema/aop"
             xmlns:mvc="http://www.springframework.org/schema/mvc"
             xmlns:context="http://www.springframework.org/schema/context"
             xmlns:tx="http://www.springframework.org/schema/tx"
             xsi:schemaLocation="
             http://www.springframework.org/schema/beans 
             http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
             http://www.springframework.org/schema/aop 
             http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
             http://www.springframework.org/schema/mvc 
             http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
             http://www.springframework.org/schema/context 
             http://www.springframework.org/schema/context/spring-context-4.0.xsd  
             http://www.springframework.org/schema/tx 
             http://www.springframework.org/schema/tx/spring-tx-4.0.xsd"&gt;    
      &lt;!-- Specify that this dispatcher works with by spring annotations--&gt;   
      &lt;mvc:annotation-driven conversion-service="conversionService"/&gt;
      &lt;context:component-scan base-package="com.exevan.ipweb.controller" /&gt;        
      &lt;!-- Spring bean that maps url's to controllers --&gt;
      &lt;bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"&gt;
          &lt;property name="mappings"&gt;
              &lt;props&gt;
                  &lt;prop key="home.htm"&gt;homeController&lt;/prop&gt;
              &lt;/props&gt;
          &lt;/property&gt;
      &lt;/bean&gt;    
      &lt;!-- Spring bean that converts logical view name to view location --&gt;
      &lt;bean id="viewResolver"          class="org.springframework.web.servlet.view.InternalResourceViewResolver"
                p:prefix="/WEB-INF/jsp/"
                p:suffix=".jsp" /&gt;
  
      &lt;!-- Index controller --&gt;
      &lt;bean name="homeController"              class="org.springframework.web.servlet.mvc.ParameterizableViewController"
                p:viewName="home" /&gt;
  
      &lt;bean id="conversionService"              class="org.springframework.context.support.ConversionServiceFactoryBean"&gt;
          &lt;property name="converters"&gt;
              &lt;list&gt;
                  &lt;bean id="dateToStringConverter" class="com.exevan.ipweb.converter.DateToStringConverter"/&gt;
                  &lt;bean id="stringToDateConverter" class="com.exevan.ipweb.converter.StringToDateConverter"/&gt;
                  &lt;bean id="idToPublisherConverter" class="com.exevan.ipweb.converter.IdToPublisherConverter"/&gt;
              &lt;/list&gt;
          &lt;/property&gt;
      &lt;/bean&gt;        
  &lt;/beans&gt;
  </code></pre>
  
  <p>My web.xml   </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;/WEB-INF/applicationContext.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;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;load-on-startup&gt;2&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.htm&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
      &lt;session-config&gt;
          &lt;session-timeout&gt;
              30
          &lt;/session-timeout&gt;
      &lt;/session-config&gt;
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;redirect.jsp&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>My redirect.jsp     </p>
  
  <pre><code>&lt;%--
  Views should be stored under the WEB-INF folder so that
  they are not accessible except through controller process.
  
  This JSP is here to provide a redirect to the dispatcher
  servlet but should be the only JSP outside of WEB-INF.
  --%&gt;
  &lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt;
  &lt;% response.sendRedirect("/home.htm"); %&gt;
  </code></pre>