title: url-pattern /* serves jsp files and static assets as seperate requests
body: <p>I have a simple servlet which renders different content based on different geo locations
  for example:</p>
  
  <pre><code>example.com/us
  example.com/de
  example.com/uk
  example.com/..
  </code></pre>
  
  <p>so actually the servlet should supports all geo locations as url-pattern. So thats why I defined the rule below in my <code>web.xml</code> file:</p>
  
  <pre><code>&lt;servlet-mapping&gt;
    servlet-name&gt;MyServlet&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>this is how the servlet look like:</p>
  
  <pre><code>public class MyServlet extends HttpServlet{
    String showPage = "/pages/show.jsp";
    public void doGet(HttpServletRequest request, HttpServletResponse response){
      System.out.println("servlet initiated... ~&gt; "+request.getRequestURI());
      ...
      request.getRequestDispatcher(showPage).forward(request, response);
  
    }
  
  }
  </code></pre>
  
  <p>As soon as I try to forward the page, the servlet starts again and again; it tries to also handle the request <code>/page/show.jsp</code>.
  So I get such an ouput when I try to access <code>example.com/us</code>:</p>
  
  <pre><code>servlet initiated... ~&gt; /us
  servlet initiated... ~&gt; /page/show.jsp
  Exception...
  servlet initiated... ~&gt; /page/show.jsp
  Exception...
  servlet initiated... ~&gt; /page/show.jsp
  ...
  </code></pre>
  
  <p>It throws an exception because my servlet is not expecting such a url-pattern <code>/page/show.jsp</code> but it triggers because I have define <code>/*</code> url-pattern in my web.xml file.</p>
  
  <p>Any idea? how can I skip or exclude the unwanted requests like the one above? Thanks.</p>