title: Servlets: doPost and doGet simple inquiry
body: <pre><code>public class CornelltaxiServlet extends HttpServlet {
  public void doGet(HttpServletRequest req, HttpServletResponse resp)
          throws IOException {
      resp.setContentType("text/plain");
      resp.getWriter().println("Hello, world");
  }
  
  public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
      //resp.setContentType("text/plain");
      //resp.getWriter().println("Hello, world");
  }
  </code></pre>
  
  <p>}</p>
  
  <p>From my understanding of doGet and doPost, it shouldn't matter where I put the "Hello, world" message. However, when I try to print it using the doPost method, it does not work. Could anyone explain this for me?</p>
  
  <p>Also, from</p>
  
  <pre><code>void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      // Preprocess request: we actually don't need to do any business stuff, so just display JSP.
      request.getRequestDispatcher("/WEB-INF/hello.jsp").forward(request, response);
  }
  
  request.getRequestDispatcher("/WEB-INF/hello.jsp").forward(request, response);
  </code></pre>
  
  <p>what does this do?</p>