1 16 17 package org.apache.tester; 18 19 20 import java.io.*; 21 import java.util.*; 22 import javax.servlet.*; 23 import javax.servlet.http.*; 24 25 26 33 34 public class UpperCaseResponse extends HttpServletResponseWrapper { 35 36 37 HttpServletResponse response = null; 38 39 boolean stream = false; 41 public UpperCaseResponse(HttpServletResponse response) { 42 this(response, false); 43 } 44 45 public UpperCaseResponse(HttpServletResponse response, boolean stream) { 46 super(response); 47 this.response = response; 48 this.stream = stream; 49 } 50 51 public ServletOutputStream getOutputStream() throws IOException { 52 return (new UpperCaseOutputStream(response.getOutputStream())); 53 } 54 55 public PrintWriter getWriter() throws IOException { 56 if (stream) 57 return (new PrintWriter(getOutputStream(), true)); 58 else 59 return (new UpperCaseWriter(response.getWriter())); 60 } 61 62 63 } 64 65 66 67 | Popular Tags |