title: @RequestMapping Couldn't find Jsp page
body: <p>I tried to build a small app in spring-boot, it's structure is given below. I am having a weird problem with @RequestMapping where it's able to find all the resources except one.</p>
  <p>Here is the <code>web.xml</code> file</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;web-app version=&quot;3.1&quot; xmlns=&quot;http://xmlns.jcp.org/xml/ns/javaee&quot;
   xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd&quot;&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;!-- Step 2: Set up URL mapping for Spring MVC Dispatcher Servlet --&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
   
   &lt;/web-app&gt;
  </code></pre>
  <p>Following is <code>applicationContext.xml</code> file</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;
      xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; 
      xmlns:context=&quot;http://www.springframework.org/schema/context&quot;
      xmlns:mvc=&quot;http://www.springframework.org/schema/mvc&quot;
      xsi:schemaLocation=&quot;
          http://www.springframework.org/schema/beans
          http://www.springframework.org/schema/beans/spring-beans.xsd
          http://www.springframework.org/schema/context
          http://www.springframework.org/schema/context/spring-context.xsd
          http://www.springframework.org/schema/mvc
          http://www.springframework.org/schema/mvc/spring-mvc.xsd&quot;&gt;
  
      &lt;!-- Step 3: Add support for component scanning --&gt;
      &lt;context:component-scan base-package=&quot;com.example.*&quot; /&gt;
  
      &lt;!-- Step 4: Add support for conversion, formatting and validation support --&gt;
      &lt;mvc:annotation-driven/&gt;
  
      &lt;!-- Step 5: Define Spring MVC view resolver --&gt;
      &lt;bean
          class=&quot;org.springframework.web.servlet.view.InternalResourceViewResolver&quot;&gt;
          &lt;property name=&quot;prefix&quot; value=&quot;/WEB-INF/views/&quot; /&gt;
          &lt;property name=&quot;suffix&quot; value=&quot;.jsp&quot; /&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  <p>in <code>com.example.controller</code> package I have two files <code>FrontController.java</code> and <code>FormController.java</code>.
  This is how they look like.</p>
  <p><code>FrontController.java</code></p>
  <pre><code>package com.example.controller;
  
  import org.springframework.stereotype.Controller;
  import org.springframework.web.bind.annotation.RequestMapping;
  
  @Controller
  public class FrontController {
  
      public FrontController() {
          // TODO Auto-generated constructor stub
      }
      
      @RequestMapping(&quot;/&quot;)
      public String showHomePage() {
          System.out.println(&quot;Reached In&quot;);
          return &quot;home&quot;;
          
      }
      
      @RequestMapping(&quot;/spring&quot;)
      public String spring() {
          
          return &quot;spring&quot;;
          
      }
  
  }
  </code></pre>
  <p><code>FormController.java</code></p>
  <pre><code>package com.example.controller;
  
  import org.springframework.stereotype.Controller;
  import org.springframework.web.bind.annotation.RequestMapping;
  
  @Controller
  public class FormController {
  
      public FormController() {
          // TODO Auto-generated constructor stub
      }
  
      @RequestMapping(&quot;/showform&quot;)
      public String showForm() {
          return &quot;showForm&quot;;
          
      }
      
      @RequestMapping(&quot;/formResp&quot;)
      public String formResp() {
          return &quot;formResp&quot;;
          
      }
  }
  </code></pre>
  <p>Now on loading my project in the server the default page I get is <code>home.jsp</code> which get displayed successfully with the following stack trace.</p>
  <pre><code>09:21:49.390 [http-nio-8080-exec-3] DEBUG org.springframework.web.servlet.view.InternalResourceView - View name 'home', model {}
  09:21:49.392 [http-nio-8080-exec-3] DEBUG org.springframework.web.servlet.view.InternalResourceView - Forwarding to [/WEB-INF/views/home.jsp]
  09:21:49.427 [http-nio-8080-exec-3] DEBUG org.springframework.web.servlet.DispatcherServlet - Completed 200 OK
  </code></pre>
  <p>Same thing happens with <code>showForm.jsp</code> page and <code>formResp.jsp</code> page in <code>FormController.java</code>, they get displayed successfully. Stacktrace below.</p>
  <pre><code>09:21:57.107 [http-nio-8080-exec-4] DEBUG org.springframework.web.servlet.DispatcherServlet - GET &quot;/WebAppDemo/showform&quot;, parameters={}
  09:21:57.107 [http-nio-8080-exec-4] DEBUG org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped to com.example.controller.FormController#showForm()
  09:21:57.108 [http-nio-8080-exec-4] DEBUG org.springframework.web.servlet.view.InternalResourceView - View name 'showForm', model {}
  09:21:57.108 [http-nio-8080-exec-4] DEBUG org.springframework.web.servlet.view.InternalResourceView - Forwarding to [/WEB-INF/views/showForm.jsp]
  09:21:57.302 [http-nio-8080-exec-4] DEBUG org.springframework.web.servlet.DispatcherServlet - Completed 200 OK
  09:22:02.378 [http-nio-8080-exec-5] DEBUG org.springframework.web.servlet.DispatcherServlet - GET &quot;/WebAppDemo/formResp?name=jony&quot;, parameters={masked}
  09:22:02.379 [http-nio-8080-exec-5] DEBUG org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped to com.example.controller.FormController#formResp()
  09:22:02.380 [http-nio-8080-exec-5] DEBUG org.springframework.web.servlet.view.InternalResourceView - View name 'formResp', model {}
  09:22:02.380 [http-nio-8080-exec-5] DEBUG org.springframework.web.servlet.view.InternalResourceView - Forwarding to [/WEB-INF/views/formResp.jsp]
  09:22:02.621 [http-nio-8080-exec-5] DEBUG org.springframework.web.servlet.DispatcherServlet - Completed 200 OK
  </code></pre>
  <p>But as soon as I try to display <code>spring.jsp</code> page in <code>FrontController.java</code> I run into <code>404 Error</code>. Stacktrace below.</p>
  <pre><code>09:22:09.179 [http-nio-8080-exec-6] DEBUG org.springframework.web.servlet.DispatcherServlet - GET &quot;/WebAppDemo/spring&quot;, parameters={}
  09:22:09.187 [http-nio-8080-exec-6] WARN org.springframework.web.servlet.PageNotFound - No mapping for GET /WebAppDemo/spring
  09:22:09.187 [http-nio-8080-exec-6] DEBUG org.springframework.web.servlet.DispatcherServlet - Completed 404 NOT_FOUND
  </code></pre>
  <p>I don't know why is it not finding <code>spring.jsp</code> page when it's located in <code>WEB-INF/views</code> folder along with other JSP files. Will deeply appreciate some help on this. Thanks in Advance.</p>