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 Include10 extends HttpServlet { 32 33 34 public void doGet(HttpServletRequest request, HttpServletResponse response) 35 throws IOException, ServletException { 36 37 StringBuffer sb = new StringBuffer (); 39 response.setContentType("text/plain"); 40 PrintWriter writer = response.getWriter(); 41 42 request.setAttribute("original.request_uri", 44 request.getRequestURI()); 45 request.setAttribute("original.context_path", 46 request.getContextPath()); 47 request.setAttribute("original.servlet_path", 48 request.getServletPath()); 49 request.setAttribute("original.path_info", 50 request.getPathInfo()); 51 request.setAttribute("original.query_string", 52 request.getQueryString()); 53 54 RequestDispatcher rd = 56 getServletContext().getRequestDispatcher 57 ("/Include10a/include/path?name2=value2"); 58 if (rd == null) { 59 sb.append(" No RequestDispatcher returned/"); 60 } else { 61 if (sb.length() < 1) 62 rd.include(request, response); 63 } 64 65 if (sb.length() >= 1) { 67 writer.print("Include00 FAILED -"); 68 writer.println(sb.toString()); 69 while (true) { 70 String message = StaticLogger.read(); 71 if (message == null) 72 break; 73 writer.println(message); 74 } 75 } 76 StaticLogger.reset(); 77 78 } 79 80 } 81 | Popular Tags |