title: doFilter called twice, intended behaviour?
body: <p>I'm working through the Java EE servlet tutorial and tried the <a href="http://docs.oracle.com/javaee/6/tutorial/doc/gkcpg.html">mood example</a>. I noticed the doFilter is getting called twice, once the servlet call is in the chain and the second time it isnt.</p>
  
  <p>I added some printlns in the TimeOfDayFilter.java and in the MoodServlet.java to show this.</p>
  
  <p>TimeOfDayFilter.java:</p>
  
  <pre><code>    ...
      System.out.println("TimeOfDay before"); //added
      chain.doFilter(req, res);
      System.out.println("TimeOfDay after"); //added
      ...
  </code></pre>
  
  <p>MoodServlet.java:</p>
  
  <pre><code>    ...
      response.setContentType("text/html;charset=UTF-8");
  
      System.out.println("MoodServlet"); //added
  
      PrintWriter out = response.getWriter();
      ...
  </code></pre>
  
  <p>The result from the glassfish server (3.1) window when calling the servlet is the following:</p>
  
  <pre><code>    INFO: mood was successfully deployed in 406 milliseconds.
      INFO: TimeOfDay before
      INFO: MoodServlet
      INFO: TimeOfDay after
      INFO: TimeOfDay before
      INFO: TimeOfDay after
  </code></pre>
  
  <p>Is this intended behaviour? If so, what is the reason for the extra call?</p>