1 16 17 package org.apache.tester; 18 19 20 import java.io.*; 21 import javax.servlet.*; 22 import javax.servlet.http.*; 23 24 30 31 public class Forward06 extends HttpServlet { 32 33 public void doGet(HttpServletRequest request, HttpServletResponse response) 34 throws IOException, ServletException { 35 36 response.setContentType("text/plain"); 38 PrintWriter writer = response.getWriter(); 39 40 RequestDispatcher rd = 42 getServletContext().getRequestDispatcher("/Forward06a.jsp"); 43 if (rd == null) { 44 writer.println("Forward05 FAILED - No request dispatcher" + 45 " for /Forward06a.jsp"); 46 } else { 47 rd.forward(request, response); 48 writer.println("Forward06 text should NOT be present"); 49 } 50 51 while (true) { 53 String message = StaticLogger.read(); 54 if (message == null) 55 break; 56 writer.println(message); 57 } 58 StaticLogger.reset(); 59 60 } 61 62 } 63 | Popular Tags |