title: Why dispatch from one servlet to another double the pathInfo?
body: <p>Hi and please excuse my english,</p>
  
  <p>I have one main servlet which dispatch all user action and one to manage request to DAO Java class. First action (click on menu) works and give me the right URL: projet/admin/groupes/gerer (project/admin/bands/manage). Second action (click on button) double the pathInfo: projet/admin/groupes/admin/groupes/creer (create).</p>
  
  <p>If I take the double path into account, it works but it's not a good solution (and if I try to click on the menu again, it triple!)</p>
  
  <p>Calls to servlet come from a JavaScript :</p>
  
  <pre><code>switch (name) {
      case 'Groupe':                          // Click on band menu from administration side
          console.log('JS: Click on admin menu Groupe');
          var url = "admin/groupes/gerer";
          location.href = url;
          break;
  
      case 'Creer':                           // Click on 'Creer' button from liste-groupe page
          console.log('JS : click on Creer');
          var url = "admin/groupes/creer";
          location.href = url;
          break;
  
      default:
          console.log('JS: no click source');
  }
  </code></pre>
  
  <p>Main servlet with urlPattern: "/admin/groupes/*", I should write "/creer" on the second case.</p>
  
  <pre><code>protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  
      pathInfo = request.getPathInfo();
      servletPath = request.getServletPath();
      System.out.println("BandController, pathInfo: " + pathInfo); // TEST CODE
      System.out.println("BandController, servletPath: " + servletPath); // TEST CODE
  
      switch (pathInfo) {
  
          // Dispatch to the management servlet
          case "/gerer":
              System.out.println("BandController : groupes (menu) &gt; BandManagement"); // TEST CODE
              dispatch = request.getRequestDispatcher("/action/gerer/listergrp");
              dispatch.forward(request, response);
              break;
  
          // FIXME fix double URL call!
          case "/admin/groupes/creer" :
              System.out.println("BandController : liste-groupes.jsp &gt; nouvellefiche.jsp"); // TEST CODE
              dispatch = request.getRequestDispatcher("/WEB-INF/jsp/admin/nouvellefiche.jsp");
              dispatch.forward(request, response);
              break;
  
          default:
              System.out.println("BandController : page 404."); // TEST CODE
              break;
  
  }
  </code></pre>
  
  <p>I hope that's enough information, I tried several different kind of path in the RequestDispatcher without success. And I just find this topic <a href="https://stackoverflow.com/questions/9131946/understanding-url-mapping-using-dispatcherservlet-using-alwaysusefullpath-proper">Understanding URL mapping using DispatcherServlet using alwaysUseFullPath property </a> which talk about double path but didn't understand the answer.</p>
  
  <p>Thanks for any help (by the way I'm a Java beginner!)</p>