title: Servlet @WebServlet urlPatterns
body: <p>This is a quick question but I couldn't find a quick answer. 
  Now I have a servlet BaseServlet, 
  when user request any of the url below:</p>
  
  <pre><code>host
  host/
  host/BaseServlet
  </code></pre>
  
  <p>It should always refer to the same servlet and redirect to the homepage. </p>
  
  <p>When I set </p>
  
  <pre><code>@WebServlet({"/BaseServlet", ""})
  </code></pre>
  
  <p>Only </p>
  
  <pre><code>host/
  host/BaseServlet
  </code></pre>
  
  <p>works</p>
  
  <p>If I set </p>
  
  <pre><code>@WebServlet({"/BaseServlet", "", "/"})
  </code></pre>
  
  <p>The BaseServlet will be requested constantly in loop ... </p>
  
  <p>Why?</p>
  
  <p>Edit: 
  BaseServlet does a forward to the index.html hid in WEB-INF folder and that's it.</p>
  
  <pre><code>getServletContext().getRequestDispatcher("/WEB-INF/index.html").forward(request,response);
  </code></pre>
  
  <p>The servlet spec says "A string containing only the / character indicates the "default" servlet of the application." So I want the BaseServlet to be my default. Why it doesn't work?</p>