Source Code Cross Referenced for ApplicationResponse.java in  » Sevlet-Container » tomcat-catalina » org » apache » catalina » core » 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 » Sevlet Container » tomcat catalina » org.apache.catalina.core 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 1999,2004 The Apache Software Foundation.
003:         * 
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         * 
008:         *      http://www.apache.org/licenses/LICENSE-2.0
009:         * 
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:
017:        package org.apache.catalina.core;
018:
019:        import java.util.Locale;
020:
021:        import javax.servlet.ServletResponse;
022:        import javax.servlet.ServletResponseWrapper;
023:
024:        import org.apache.catalina.util.StringManager;
025:
026:        /**
027:         * Wrapper around a <code>javax.servlet.ServletResponse</code>
028:         * that transforms an application response object (which might be the original
029:         * one passed to a servlet, or might be based on the 2.3
030:         * <code>javax.servlet.ServletResponseWrapper</code> class)
031:         * back into an internal <code>org.apache.catalina.Response</code>.
032:         * <p>
033:         * <strong>WARNING</strong>:  Due to Java's lack of support for multiple
034:         * inheritance, all of the logic in <code>ApplicationResponse</code> is
035:         * duplicated in <code>ApplicationHttpResponse</code>.  Make sure that you
036:         * keep these two classes in synchronization when making changes!
037:         *
038:         * @author Craig R. McClanahan
039:         * @version $Revision: 1.4 $ $Date: 2004/02/27 14:58:42 $
040:         */
041:
042:        class ApplicationResponse extends ServletResponseWrapper {
043:
044:            // ----------------------------------------------------------- Constructors
045:
046:            /**
047:             * Construct a new wrapped response around the specified servlet response.
048:             *
049:             * @param response The servlet response being wrapped
050:             */
051:            public ApplicationResponse(ServletResponse response) {
052:
053:                this (response, false);
054:
055:            }
056:
057:            /**
058:             * Construct a new wrapped response around the specified servlet response.
059:             *
060:             * @param response The servlet response being wrapped
061:             * @param included <code>true</code> if this response is being processed
062:             *  by a <code>RequestDispatcher.include()</code> call
063:             */
064:            public ApplicationResponse(ServletResponse response,
065:                    boolean included) {
066:
067:                super (response);
068:                setIncluded(included);
069:
070:            }
071:
072:            // ----------------------------------------------------- Instance Variables
073:
074:            /**
075:             * Is this wrapped response the subject of an <code>include()</code>
076:             * call?
077:             */
078:            protected boolean included = false;
079:
080:            /**
081:             * The string manager for this package.
082:             */
083:            protected static StringManager sm = StringManager
084:                    .getManager(Constants.Package);
085:
086:            // ------------------------------------------------ ServletResponse Methods
087:
088:            /**
089:             * Disallow <code>reset()</code> calls on a included response.
090:             *
091:             * @exception IllegalStateException if the response has already
092:             *  been committed
093:             */
094:            public void reset() {
095:
096:                // If already committed, the wrapped response will throw ISE
097:                if (!included || getResponse().isCommitted())
098:                    getResponse().reset();
099:
100:            }
101:
102:            /**
103:             * Disallow <code>setContentLength()</code> calls on an included response.
104:             *
105:             * @param len The new content length
106:             */
107:            public void setContentLength(int len) {
108:
109:                if (!included)
110:                    getResponse().setContentLength(len);
111:
112:            }
113:
114:            /**
115:             * Disallow <code>setContentType()</code> calls on an included response.
116:             *
117:             * @param type The new content type
118:             */
119:            public void setContentType(String type) {
120:
121:                if (!included)
122:                    getResponse().setContentType(type);
123:
124:            }
125:
126:            /**
127:             * Ignore <code>setLocale()</code> calls on an included response.
128:             *
129:             * @param loc The new locale
130:             */
131:            public void setLocale(Locale loc) {
132:                if (!included)
133:                    getResponse().setLocale(loc);
134:            }
135:
136:            /**
137:             * Ignore <code>setBufferSize()</code> calls on an included response.
138:             *
139:             * @param size The buffer size
140:             */
141:            public void setBufferSize(int size) {
142:                if (!included)
143:                    getResponse().setBufferSize(size);
144:            }
145:
146:            // ----------------------------------------- ServletResponseWrapper Methods
147:
148:            /**
149:             * Set the response that we are wrapping.
150:             *
151:             * @param response The new wrapped response
152:             */
153:            public void setResponse(ServletResponse response) {
154:
155:                super .setResponse(response);
156:
157:            }
158:
159:            // -------------------------------------------------------- Package Methods
160:
161:            /**
162:             * Return the included flag for this response.
163:             */
164:            boolean isIncluded() {
165:
166:                return (this .included);
167:
168:            }
169:
170:            /**
171:             * Set the included flag for this response.
172:             *
173:             * @param included The new included flag
174:             */
175:            void setIncluded(boolean included) {
176:
177:                this.included = included;
178:
179:            }
180:
181:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.