1 7 package com.inversoft.junit.internal.http; 8 9 10 import java.io.IOException ; 11 12 import javax.servlet.RequestDispatcher ; 13 import javax.servlet.ServletException ; 14 import javax.servlet.ServletRequest ; 15 import javax.servlet.ServletResponse ; 16 17 18 38 public class RequestDispatcherWrapper implements RequestDispatcher { 39 40 43 protected RequestDispatcher rd; 44 45 46 50 public RequestDispatcherWrapper(RequestDispatcher rd) { 51 this.rd = rd; 52 } 53 54 55 58 public RequestDispatcher getWrappedRequestDispatcher() { 59 return rd; 60 } 61 62 63 public void forward(ServletRequest request, ServletResponse response) 64 throws IOException , ServletException { 65 System.out.println("Forwarding! class is [" + request + "]"); 66 rd.forward(((HttpServletRequestWrapper) request).getRequest(), 67 ((HttpServletResponseWrapper) response).getResponse()); 68 } 69 70 71 public void include(ServletRequest request, ServletResponse response) 72 throws IOException , ServletException { 73 rd.include(((HttpServletRequestWrapper) request).getRequest(), 74 ((HttpServletResponseWrapper) response).getResponse()); 75 } 76 } 77 | Popular Tags |