Source Code Cross Referenced for MockHttpServletResponse.java in  » J2EE » facelets » com » sun » facelets » mock » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » facelets » com.sun.facelets.mock 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
003:         * Licensed under the Common Development and Distribution License,
004:         * you may not use this file except in compliance with the License.
005:         * You may obtain a copy of the License at
006:         * 
007:         *   http://www.sun.com/cddl/
008:         *   
009:         * Unless required by applicable law or agreed to in writing, software
010:         * distributed under the License is distributed on an "AS IS" BASIS,
011:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 
012:         * implied. See the License for the specific language governing
013:         * permissions and limitations under the License.
014:         */package com.sun.facelets.mock;
015:
016:        import java.io.IOException;
017:        import java.io.PrintWriter;
018:        import java.util.Hashtable;
019:        import java.util.Locale;
020:
021:        import javax.servlet.ServletOutputStream;
022:        import javax.servlet.http.Cookie;
023:        import javax.servlet.http.HttpServletResponse;
024:
025:        /**
026:         * 
027:         * @author Jacob Hookom
028:         * @version $Id: MockHttpServletResponse.java,v 1.2 2005/07/19 00:49:01 jhook Exp $
029:         */
030:        public class MockHttpServletResponse implements  HttpServletResponse {
031:
032:            private boolean committed = false;
033:            private int status;
034:            private String message;
035:            private Hashtable headers = new Hashtable();
036:            private String characterEncoding = "ISO-8859-1";
037:            private String contentType = "text/html";
038:            private long contentLength = 0;
039:            private int bufferSize = 0;
040:            private Locale locale = Locale.getDefault();
041:
042:            public MockHttpServletResponse() {
043:                super ();
044:            }
045:
046:            public void addCookie(Cookie cookie) {
047:                // TODO Auto-generated method stub
048:
049:            }
050:
051:            public boolean containsHeader(String name) {
052:                return this .headers.contains(name);
053:            }
054:
055:            public String encodeURL(String url) {
056:                return url;
057:            }
058:
059:            public String encodeRedirectURL(String url) {
060:                return url;
061:            }
062:
063:            public String encodeUrl(String url) {
064:                return url;
065:            }
066:
067:            public String encodeRedirectUrl(String url) {
068:                return this .encodeRedirectURL(url);
069:            }
070:
071:            public void sendError(int status, String message)
072:                    throws IOException {
073:                if (this .committed) {
074:                    throw new IllegalStateException(
075:                            "Response is already committed");
076:                }
077:                this .status = status;
078:                this .message = message;
079:                this .committed = true;
080:            }
081:
082:            public void sendError(int status) throws IOException {
083:                if (this .committed) {
084:                    throw new IllegalStateException(
085:                            "Response is already committed");
086:                }
087:                this .status = status;
088:                this .committed = true;
089:            }
090:
091:            public void sendRedirect(String path) throws IOException {
092:                if (this .committed) {
093:                    throw new IllegalStateException(
094:                            "Response is already committed");
095:                }
096:                this .committed = true;
097:            }
098:
099:            public void setDateHeader(String name, long date) {
100:                this .headers.put(name, "" + date);
101:            }
102:
103:            public void addDateHeader(String name, long date) {
104:                this .headers.put(name, "" + date);
105:            }
106:
107:            public void setHeader(String name, String value) {
108:                this .headers.put(name, value);
109:            }
110:
111:            public void addHeader(String name, String value) {
112:                this .headers.put(name, value);
113:            }
114:
115:            public void setIntHeader(String name, int value) {
116:                this .headers.put(name, "" + value);
117:            }
118:
119:            public void addIntHeader(String name, int value) {
120:                this .headers.put(name, "" + value);
121:            }
122:
123:            public void setStatus(int sc) {
124:                this .status = sc;
125:            }
126:
127:            public void setStatus(int sc, String message) {
128:                this .status = sc;
129:                this .message = message;
130:            }
131:
132:            public String getCharacterEncoding() {
133:                return this .characterEncoding;
134:            }
135:
136:            public String getContentType() {
137:                return this .contentType;
138:            }
139:
140:            public ServletOutputStream getOutputStream() throws IOException {
141:                // TODO Auto-generated method stub
142:                return null;
143:            }
144:
145:            public PrintWriter getWriter() throws IOException {
146:                // TODO Auto-generated method stub
147:                return null;
148:            }
149:
150:            public void setCharacterEncoding(String characterEncoding) {
151:                this .characterEncoding = characterEncoding;
152:            }
153:
154:            public void setContentLength(int contentLength) {
155:                this .contentLength = contentLength;
156:            }
157:
158:            public void setContentType(String contentType) {
159:                this .contentType = contentType;
160:            }
161:
162:            public void setBufferSize(int sz) {
163:                this .bufferSize = sz;
164:            }
165:
166:            public int getBufferSize() {
167:                return this .bufferSize;
168:            }
169:
170:            public void flushBuffer() throws IOException {
171:
172:            }
173:
174:            public void resetBuffer() {
175:
176:            }
177:
178:            public boolean isCommitted() {
179:                return this .committed;
180:            }
181:
182:            public void reset() {
183:                // TODO Auto-generated method stub
184:
185:            }
186:
187:            public void setLocale(Locale locale) {
188:                this .locale = locale;
189:            }
190:
191:            public Locale getLocale() {
192:                return this.locale;
193:            }
194:
195:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.