1 17 18 package org.apache.jasper.runtime; 19 20 import java.io.IOException ; 21 import java.io.PrintWriter ; 22 23 import javax.servlet.ServletOutputStream ; 24 import javax.servlet.ServletResponse ; 25 import javax.servlet.http.HttpServletResponse ; 26 import javax.servlet.http.HttpServletResponseWrapper ; 27 import javax.servlet.jsp.JspWriter ; 28 29 38 39 public class ServletResponseWrapperInclude extends HttpServletResponseWrapper { 40 41 44 private PrintWriter printWriter; 45 46 private JspWriter jspWriter; 47 48 public ServletResponseWrapperInclude(ServletResponse response, 49 JspWriter jspWriter) { 50 super((HttpServletResponse )response); 51 this.printWriter = new PrintWriter (jspWriter); 52 this.jspWriter = jspWriter; 53 } 54 55 58 public PrintWriter getWriter() throws IOException { 59 return printWriter; 60 } 61 62 public ServletOutputStream getOutputStream() throws IOException { 63 throw new IllegalStateException (); 64 } 65 66 70 public void resetBuffer() { 71 try { 72 jspWriter.clearBuffer(); 73 } catch (IOException ioe) { 74 } 75 } 76 } 77 | Popular Tags |