title: How remove context path in java application
body: <p>I want to remove context path from my url. when i run project its run in <code>http:///localhost:8080/myApp/</code>. i want to remove myApp from it. 
  all my config based on java. i change context.xml to this <code>&lt;Context antiJARLocking="true" path="/"/&gt;</code> but when i want to login that based on spring security not working. I also add web.xml based java config like this. </p>
  
  <pre><code>     public class AppInitializer implements WebApplicationInitializer {
  
      @Override
      public void onStartup(ServletContext servletContext) throws   ServletException {
      WebApplicationContext context = getContext();
      servletContext.addListener(new ContextLoaderListener(context));
      ServletRegistration.Dynamic dispatcher =   servletContext.addServlet("DispatcherServlet", new   DispatcherServlet(context));
      dispatcher.setLoadOnStartup(1);
      dispatcher.addMapping("/");
    }
  
  private AnnotationConfigWebApplicationContext getContext() {
      AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
      context.setConfigLocation("mypac.config");
      return context;
   }
  }
  </code></pre>