title: Getting 404 after deploying to app server but not locally
body: <p>I am building web service with Spring @RestController.  When testing it locally, everything is fine.  However, after deploy the app to a remote application server, I am getting 404 back when hitting the same endpoint.  Here's my codes:</p>
  
  <pre><code>@RestController
  public class HelloRestController
  {   
      @RequestMapping(  value = "/hello", method = RequestMethod.GET )
      public String hello()
      {
          return "hello";
      }
  }
  </code></pre>
  
  <p>Here's my web application initializer.  Note: I don't have a web.xml file.</p>
  
  <pre><code>public class MyApplicationInitializer implements WebApplicationInitializer
  {
      @Override
      public void onStartup( ServletContext servletContext ) throws ServletException
      {
          AnnotationConfigWebApplicationContext ctx =
              new AnnotationConfigWebApplicationContext();
  
          servletContext.addListener( new ContextLoaderListener( ctx ) );
  
          ctx.register( WebApplicationConfig.class, ApplicationConfig.class );
  
          ctx.setServletContext( servletContext );
  
          Dynamic dispatcher =
              servletContext.addServlet( "SpringServlet", new DispatcherServlet( ctx ) );
  
          dispatcher.addMapping( "/" );
          dispatcher.setLoadOnStartup( 1 );
      }
  }
  </code></pre>
  
  <p>When I deploy the app locally to Tomcat-8.0.15 and hit "localhost:8080/myApp/hello", it returns "hello".  However, after deploying the app to the remote application server (also Tomcat 8), I am getting 404 back when trying hit the same endpoint.</p>
  
  <p>Thanks in advance for your helps!</p>