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

Quick Search    Search Deep

Source code: dispatch/SimpleForwardServlet.java


1   /*
2    * $Id: SimpleForwardServlet.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 SimpleForwardServlet 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    res.setContentType("text/foobar");
23    String s = "/servlet/dispatch.Target1";
24    RequestDispatcher rd = context.getRequestDispatcher(s);
25    rd.forward(req, res);
26      }
27  }
28  
29  
30