01: /*
02: * Copyright (c) 2002-2003 by OpenSymphony
03: * All rights reserved.
04: */
05: package com.opensymphony.webwork.views.jsp;
06:
07: import com.mockobjects.servlet.MockHttpServletResponse;
08:
09: import java.io.ByteArrayOutputStream;
10: import java.io.IOException;
11: import java.io.PrintWriter;
12: import java.util.Locale;
13:
14: /**
15: * WebWorkMockHttpServletResponse
16: *
17: * @author Jason Carreira
18: * @author tm_jee
19: * @version $Date: 2006-03-11 07:23:02 +0100 (Sat, 11 Mar 2006) $ $Id: WebWorkMockHttpServletResponse.java 2357 2006-03-11 06:23:02Z tmjee $
20: */
21: public class WebWorkMockHttpServletResponse extends
22: MockHttpServletResponse {
23: private Locale locale;
24: private PrintWriter writer;
25:
26: public Locale getLocale() {
27: return locale;
28: }
29:
30: public void setLocale(Locale locale) {
31: this .locale = locale;
32: }
33:
34: public PrintWriter getWriter() throws IOException {
35: if (writer == null)
36: return new PrintWriter(new ByteArrayOutputStream());
37: else
38: return writer;
39: }
40:
41: public void setWriter(PrintWriter writer) {
42: this .writer = writer;
43: }
44:
45: public String encodeURL(String s) {
46: return s;
47: }
48:
49: public String encodeUrl(String s) {
50: return s;
51: }
52: }
|