1 16 17 package org.apache.tester; 18 19 20 import java.io.*; 21 import javax.servlet.*; 22 import javax.servlet.http.*; 23 import org.apache.tester.shared.SharedSessionBean; 24 import org.apache.tester.unshared.UnsharedSessionBean; 25 26 27 35 36 public class Context00 extends HttpServlet { 37 38 39 public void destroy() { 40 getServletContext().log("Context00: Removing attribute 'context00'"); 41 getServletContext().removeAttribute("context00"); 42 } 43 44 45 public void init() throws ServletException { 46 getServletContext().log("Context00: Setting attribute 'context00'"); 47 ContextBean cb = new ContextBean(); 48 cb.setStringProperty("Context00"); 49 getServletContext().setAttribute("context00", cb); 50 } 51 52 53 public void doGet(HttpServletRequest request, HttpServletResponse response) 54 throws IOException, ServletException { 55 response.setContentType("text/plain"); 56 PrintWriter writer = response.getWriter(); 57 writer.println("Context00 PASSED"); 58 while (true) { 59 String message = StaticLogger.read(); 60 if (message == null) 61 break; 62 writer.println(message); 63 } 64 StaticLogger.reset(); 65 } 66 67 68 } 69 | Popular Tags |