1 17 18 19 package org.apache.catalina.core; 20 21 22 import java.util.Locale ; 23 24 import javax.servlet.ServletResponse ; 25 import javax.servlet.ServletResponseWrapper ; 26 27 import org.apache.catalina.util.StringManager; 28 29 30 45 46 class ApplicationResponse extends ServletResponseWrapper { 47 48 49 51 52 57 public ApplicationResponse(ServletResponse response) { 58 59 this(response, false); 60 61 } 62 63 64 71 public ApplicationResponse(ServletResponse response, boolean included) { 72 73 super(response); 74 setIncluded(included); 75 76 } 77 78 79 81 82 86 protected boolean included = false; 87 88 89 92 protected static StringManager sm = 93 StringManager.getManager(Constants.Package); 94 95 96 98 99 105 public void reset() { 106 107 if (!included || getResponse().isCommitted()) 109 getResponse().reset(); 110 111 } 112 113 114 119 public void setContentLength(int len) { 120 121 if (!included) 122 getResponse().setContentLength(len); 123 124 } 125 126 127 132 public void setContentType(String type) { 133 134 if (!included) 135 getResponse().setContentType(type); 136 137 } 138 139 140 145 public void setLocale(Locale loc) { 146 if (!included) 147 getResponse().setLocale(loc); 148 } 149 150 151 156 public void setBufferSize(int size) { 157 if (!included) 158 getResponse().setBufferSize(size); 159 } 160 161 162 164 165 170 public void setResponse(ServletResponse response) { 171 172 super.setResponse(response); 173 174 } 175 176 177 179 180 183 boolean isIncluded() { 184 185 return (this.included); 186 187 } 188 189 190 195 void setIncluded(boolean included) { 196 197 this.included = included; 198 199 } 200 201 202 } 203 | Popular Tags |