View Javadoc

1   /*
2    * Created on 2004/11/10
3    */
4   package org.ieee.shinobu.demo.velocity.importsupport;
5   
6   import java.io.IOException;
7   import java.io.PrintWriter;
8   
9   import javax.servlet.ServletException;
10  import javax.servlet.http.HttpServlet;
11  import javax.servlet.http.HttpServletRequest;
12  import javax.servlet.http.HttpServletResponse;
13  
14  /***
15   * @author shinobu
16   */
17  public class MultipleWriterServlet extends HttpServlet {
18  
19      /* (non-Javadoc)
20       * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
21       */
22      protected void doGet(HttpServletRequest request, HttpServletResponse response)
23              throws ServletException, IOException {
24          PrintWriter writer = response.getWriter();
25          writer.println("I am " + this.getClass().getName());
26          writer.println("I am going to test a bug.");
27          
28  //        writer.println("Second call to getWriter().");
29          response.getWriter().println("Second call to getWriter().");
30      }
31      
32  }