Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: dispatch/PrintWriterTest1Servlet.java


1   /*
2    * $Id: PrintWriterTest1Servlet.java,v 1.1.1.1 2000/02/26 01:32:22 shawn Exp $
3    */
4   
5   package dispatch;
6   
7   import javax.servlet.*;
8   import javax.servlet.http.*;
9   import java.io.*;
10  
11  public class PrintWriterTest1Servlet extends HttpServlet {
12  
13      private ServletContext context;
14      
15      public void init() {
16    context = getServletConfig().getServletContext();
17      }
18      
19      public void doGet(HttpServletRequest req, HttpServletResponse res)
20          throws ServletException, IOException
21      {
22    ServletOutputStream sos = res.getOutputStream();
23  
24          sos.println("PreInclude");
25  
26          String sLoc = "/servlet/dispatch.PrintWriterTest2Servlet";
27          RequestDispatcher rd = context.getRequestDispatcher(sLoc);
28          rd.include(req, res);
29  
30          sos.println("PostInclude");
31      }
32  }