title: I am getting status 404 while running Spring MVC app on server
body: <p>My files are as shown below. I am not able to figure out. The error is:
  HTTP Status 404 – Not Found</p>
  
  <p>Type Status Report</p>
  
  <p>Message /onlineshoppingrks/</p>
  
  <p>Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.</p>
  
  <p>Apache Tomcat/9.0.1
  This is my web.xml file
  Web.xml</p>
  
  <pre><code>&lt;web-app 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"
      version="3.1"&gt;
      &lt;display-name&gt;Archetype Created Web Application&lt;/display-name&gt;
  
  
      &lt;!-- Configuring front controller --&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;/servlet&gt;
  
  &lt;!--  it should go through the front controller --&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>This is my PageController file
  PageController</p>
  
  <pre><code>package net.rks.onlineshoppingrks.controller;
  
  import org.springframework.stereotype.Controller;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.servlet.ModelAndView;
  
  @Controller
  public class PageController {
  
      @RequestMapping(value= {"/","/home","/index"})
      public ModelAndView index() {
  
          ModelAndView mv = new ModelAndView("page");
          return mv;
      }
  }
  </code></pre>
  
  <p>This is my dispatcher-servlet file
  dispatcher-servlet.xml</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"
      xsi:schemaLocation="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      
     "&gt;
  
      &lt;context:component-scan base-package="net.rks.onlineshoppingrks.controller"/&gt;
  
      &lt;bean id="viewResolver"
          class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
  
      &lt;property name="prefix" value="/WEB-INF/views/" /&gt;
      &lt;property name="suffix" value=".jsp" /&gt;
  
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>I am trying to build a onlineshopping web app.</p>