title: Compiling a simple hello world servlet into a .war for tomcat
body: <p>I'm doing some simple benchmarks, and I want to create a simple servlet that displays hello world, I have that part:</p>
  
  <pre><code>import java.io.*;
  import javax.servlet.*;
  import javax.servlet.http.*;
  
  public class HelloWorld extends HttpServlet{ 
    public void doGet(HttpServletRequest request, 
    HttpServletResponse response)
    throws ServletException,IOException{
    response.setContentType("text/html");
    PrintWriter pw = response.getWriter();
    pw.println("&lt;html&gt;");
    pw.println("&lt;head&gt;&lt;title&gt;Hello World&lt;/title&gt;&lt;/title&gt;");
    pw.println("&lt;body&gt;");
    pw.println("&lt;h1&gt;Hello World&lt;/h1&gt;");
    pw.println("&lt;/body&gt;&lt;/html&gt;");
    }
  }
  </code></pre>
  
  <p>Now I installed with the default installation of tomcat, in the folder:</p>
  
  <p>.../libexec/webapps/ROOT</p>
  
  <p>I believe I have to drop a war file, is it possible to compile the above java class into a .war file w/o and editor using the command line only?</p>