01: /*
02: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tctest.webapp.servlets;
05:
06: import java.io.IOException;
07:
08: import javax.servlet.http.HttpServlet;
09: import javax.servlet.http.HttpServletRequest;
10: import javax.servlet.http.HttpServletResponse;
11:
12: public final class RequestForwardTestForwardeeServlet extends
13: HttpServlet {
14: protected void doGet(HttpServletRequest req,
15: HttpServletResponse resp) throws IOException {
16: final String action = req.getParameter("action");
17: System.err.println("\n### ForwardEEServlet.doGet is here...: "
18: + action);
19: String reply = "FORWARD OK";
20:
21: if (action.endsWith("s")) {
22: req.getSession();
23: reply = "FORWARD GOT SESSION";
24: } else if (action.endsWith("n")) {
25: reply = "FORWARD DID NOT GET SESSION";
26: } else {
27: reply = "INVALID REQUEST";
28: }
29:
30: System.err.println("### reply=" + reply);
31: resp.getWriter().print(reply);
32: resp.flushBuffer();
33: }
34: }
|