Source code: dispatch/ForwardWithQueryServlet.java
1 /*
2 * $Id: ForwardWithQueryServlet.java,v 1.1.1.1 2000/02/26 01:32:22 shawn Exp $
3 */
4
5 /**
6 * Test FORWARD with a query string
7 *
8 * @author Arun Jamwal [arunj@eng.sun.com]
9 */
10
11 package dispatch;
12
13 import javax.servlet.*;
14 import javax.servlet.http.*;
15 import java.io.*;
16
17 public class ForwardWithQueryServlet extends HttpServlet {
18
19 public void init() {
20 context = getServletConfig().getServletContext();
21 }
22
23 public void doGet(HttpServletRequest req, HttpServletResponse res)
24 throws ServletException, IOException
25 {
26 res.setContentType(ContentType);
27 RequestDispatcher rd = context.getRequestDispatcher(TargetServlet);
28 rd.forward(req, res);
29 }
30
31
32 private ServletContext context;
33 private static final String ContentType = "text/foobar";
34 private static final String TargetServlet =
35 "/servlet/dispatch.ForwardWithQueryTarget";
36 }
37
38
39