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: import javax.servlet.http.HttpSession;
12:
13: public final class OkServlet extends HttpServlet {
14:
15: public void doGet(HttpServletRequest request,
16: HttpServletResponse response) throws IOException {
17: HttpSession session = request.getSession(true);
18: response.setContentType("text/html");
19: String cmd = request.getParameter("cmd");
20:
21: if (cmd != null && cmd.equals("getMaxInactiveInterval")) {
22: response.getWriter().println(
23: session.getMaxInactiveInterval());
24: } else {
25: session.setAttribute("da", "bomb");
26: response.getWriter().println("OK");
27: }
28:
29: }
30: }
|