1 17 package servletunit.struts; 18 19 import javax.servlet.ServletOutputStream ; 20 import javax.servlet.http.Cookie ; 21 import javax.servlet.http.HttpServletResponse ; 22 import java.io.IOException ; 23 import java.io.PrintWriter ; 24 import java.util.Locale ; 25 26 33 public class StrutsResponseWrapper implements HttpServletResponse  34 { 35 36 private HttpServletResponse response; 37 private String redirectLocation; 38 39 public StrutsResponseWrapper(HttpServletResponse response) { 40 this.response = response; 41 } 42 43 public void addCookie(Cookie cookie) 44 { 45 this.response.addCookie(cookie); 46 } 47 48 public void addDateHeader(String name, long date) 49 { 50 this.response.addDateHeader(name,date); 51 } 52 53 public void addHeader(String name, String value) 54 { 55 this.response.addHeader(name,value); 56 } 57 58 public void addIntHeader(String name, int value) 59 { 60 this.response.addIntHeader(name,value); 61 } 62 63 public boolean containsHeader(String name) 64 { 65 return this.response.containsHeader(name); 66 } 67 68 public String encodeRedirectUrl(String url) 69 { 70 return this.response.encodeRedirectUrl(url); 71 } 72 73 public String encodeRedirectURL(String url) 74 { 75 return this.response.encodeRedirectURL(url); 76 } 77 78 public String encodeUrl(String url) 79 { 80 return this.response.encodeUrl(url); 81 } 82 83 public String encodeURL(String url) 84 { 85 return this.response.encodeURL(url); 86 } 87 88 public void flushBuffer() throws IOException  89 { 90 this.response.flushBuffer(); 91 } 92 93 public int getBufferSize() 94 { 95 return this.response.getBufferSize(); 96 } 97 98 public String getCharacterEncoding() 99 { 100 return this.response.getCharacterEncoding(); 101 } 102 103 public Locale getLocale() 104 { 105 return this.response.getLocale(); 106 } 107 108 public ServletOutputStream getOutputStream() throws IOException  109 { 110 return this.response.getOutputStream(); 111 } 112 113 public PrintWriter getWriter() throws IOException  114 { 115 return this.response.getWriter(); 116 } 117 118 public boolean isCommitted() 119 { 120 return this.response.isCommitted(); 121 } 122 123 public void reset() 124 { 125 this.response.reset(); 126 } 127 128 public void resetBuffer() 129 { 130 } 131 132 public void sendError(int sc) throws IOException  133 { 134 this.response.sendError(sc); 135 } 136 137 public void sendError(int sc, String msg) throws IOException  138 { 139 this.response.sendError(sc,msg); 140 } 141 142 public void sendRedirect(String location) throws IOException  143 { 144 this.redirectLocation = location; 145 this.response.sendRedirect(location); 146 } 147 148 public void setBufferSize(int size) 149 { 150 this.response.setBufferSize(size); 151 } 152 153 public void setContentLength(int len) 154 { 155 this.response.setContentLength(len); 156 } 157 158 public void setContentType(String type) 159 { 160 this.response.setContentType(type); 161 } 162 163 public void setDateHeader(String name, long date) 164 { 165 this.response.setDateHeader(name,date); 166 } 167 168 public void setHeader(String name, String value) 169 { 170 this.response.setHeader(name,value); 171 } 172 173 public void setIntHeader(String name, int value) 174 { 175 this.response.setIntHeader(name,value); 176 } 177 178 public void setStatus(int sc) 179 { 180 this.response.setStatus(sc); 181 } 182 183 public void setStatus(int sc, String sm) 184 { 185 this.response.setStatus(sc,sm); 186 } 187 188 public void setLocale(Locale loc) 189 { 190 this.response.setLocale(loc); 191 } 192 193 public String getRedirectLocation() { 194 return this.redirectLocation; 195 } 196 197 } 198 199
| Popular Tags
|