title: Does Tomcat automatically compile java servlets?
body: <p>I'm using Tomcat 7.0 with Eclipse. The tomcat server is synchronized with eclipse. After creating my first class, I put the .java file under src/(default package)/HelloWorld.java (not good practice I know but just for testing)</p>
  
  <p>The content is just as follows, fairly simple:</p>
  
  <pre><code>import java.io.*;
  import javax.servlet.*;
  import javax.servlet.annotation.WebServlet;
  import javax.servlet.http.*;
  
  @WebServlet("/HelloWorld")
  
  public class HelloWorld extends HttpServlet {
      public void doGet(HttpServletRequest request, HttpServletResponse response) 
          throws ServletException, IOException {
          response.setContentType("text/html");
          PrintWriter out = response.getWriter();
          out.println ("Hello World");
      }
  }
  </code></pre>
  
  <p>Well many tutorials claim that I must use <code>javac</code> to compile the code. But I did nothing and it ran with no problem. Also everytime I change the code it updates immediately just like magic. Something must be working but I don't know what it is.</p>
  
  <p>Yeah it's obviously a newbie question so any help is welcome. Also It's better if you have any systematical and easy-to-follow tutorial links. I'm searching for them for several days but got lots of inconsistent answers.  </p>