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


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