Mercurial Hosting > luan
comparison src/org/eclipse/jetty/server/Request.java @ 994:4e9d373bf6e9
remove ContextHandler.Context
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 18 Oct 2016 16:34:18 -0600 |
parents | 688c39c50ee3 |
children | 7d28be82ab75 |
comparison
equal
deleted
inserted
replaced
993:d9d95acded81 | 994:4e9d373bf6e9 |
---|---|
77 import org.eclipse.jetty.io.EndPoint; | 77 import org.eclipse.jetty.io.EndPoint; |
78 import org.eclipse.jetty.io.nio.DirectNIOBuffer; | 78 import org.eclipse.jetty.io.nio.DirectNIOBuffer; |
79 import org.eclipse.jetty.io.nio.IndirectNIOBuffer; | 79 import org.eclipse.jetty.io.nio.IndirectNIOBuffer; |
80 import org.eclipse.jetty.io.nio.NIOBuffer; | 80 import org.eclipse.jetty.io.nio.NIOBuffer; |
81 import org.eclipse.jetty.server.handler.ContextHandler; | 81 import org.eclipse.jetty.server.handler.ContextHandler; |
82 import org.eclipse.jetty.server.handler.ContextHandler.Context; | |
83 import org.eclipse.jetty.util.Attributes; | 82 import org.eclipse.jetty.util.Attributes; |
84 import org.eclipse.jetty.util.AttributesMap; | 83 import org.eclipse.jetty.util.AttributesMap; |
85 import org.eclipse.jetty.util.IO; | 84 import org.eclipse.jetty.util.IO; |
86 import org.eclipse.jetty.util.LazyList; | 85 import org.eclipse.jetty.util.LazyList; |
87 import org.eclipse.jetty.util.MultiException; | 86 import org.eclipse.jetty.util.MultiException; |
134 | 133 |
135 private volatile Attributes _attributes; | 134 private volatile Attributes _attributes; |
136 private MultiMap<String> _baseParameters; | 135 private MultiMap<String> _baseParameters; |
137 private String _characterEncoding; | 136 private String _characterEncoding; |
138 protected AbstractHttpConnection _connection; | 137 protected AbstractHttpConnection _connection; |
139 private ContextHandler.Context _context; | 138 public ContextHandler _contextHandler = null; |
140 private String _contextPath; | 139 private String _contextPath; |
141 private CookieCutter _cookies; | 140 private CookieCutter _cookies; |
142 private boolean _cookiesExtracted = false; | 141 private boolean _cookiesExtracted = false; |
143 private EndPoint _endp; | 142 private EndPoint _endp; |
144 private boolean _handled = false; | 143 private boolean _handled = false; |
386 * @see javax.servlet.ServletRequest#getContentType() | 385 * @see javax.servlet.ServletRequest#getContentType() |
387 */ | 386 */ |
388 public String getContentType() | 387 public String getContentType() |
389 { | 388 { |
390 return _connection._requestFields.getStringField(HttpHeaders.CONTENT_TYPE_BUFFER); | 389 return _connection._requestFields.getStringField(HttpHeaders.CONTENT_TYPE_BUFFER); |
391 } | |
392 | |
393 /* ------------------------------------------------------------ */ | |
394 /** | |
395 * @return The current {@link Context context} used for this request, or <code>null</code> if {@link #setContext} has not yet been called. | |
396 */ | |
397 public Context getContext() | |
398 { | |
399 return _context; | |
400 } | 390 } |
401 | 391 |
402 /* ------------------------------------------------------------ */ | 392 /* ------------------------------------------------------------ */ |
403 /* | 393 /* |
404 * @see javax.servlet.http.HttpServletRequest#getContextPath() | 394 * @see javax.servlet.http.HttpServletRequest#getContextPath() |
1202 _reader = null; | 1192 _reader = null; |
1203 } | 1193 } |
1204 } | 1194 } |
1205 | 1195 |
1206 _handled = false; | 1196 _handled = false; |
1207 if (_context != null) | 1197 if (_contextHandler != null) |
1208 throw new IllegalStateException("Request in context!"); | 1198 throw new IllegalStateException("Request in context!"); |
1209 if (_attributes != null) | 1199 if (_attributes != null) |
1210 _attributes.clearAttributes(); | 1200 _attributes.clearAttributes(); |
1211 _characterEncoding = null; | 1201 _characterEncoding = null; |
1212 _contextPath = null; | 1202 _contextPath = null; |
1213 if (_cookies != null) | 1203 if (_cookies != null) |
1214 _cookies.reset(); | 1204 _cookies.reset(); |
1215 _cookiesExtracted = false; | 1205 _cookiesExtracted = false; |
1216 _context = null; | |
1217 _serverName = null; | 1206 _serverName = null; |
1218 _method = null; | 1207 _method = null; |
1219 _pathInfo = null; | 1208 _pathInfo = null; |
1220 _port = 0; | 1209 _port = 0; |
1221 _protocol = HttpVersions.HTTP_1_1; | 1210 _protocol = HttpVersions.HTTP_1_1; |
1303 | 1292 |
1304 } | 1293 } |
1305 | 1294 |
1306 /* ------------------------------------------------------------ */ | 1295 /* ------------------------------------------------------------ */ |
1307 /** | 1296 /** |
1308 * Set request context | |
1309 * | |
1310 * @param context | |
1311 * context object | |
1312 */ | |
1313 public void setContext(Context context) | |
1314 { | |
1315 _context = context; | |
1316 } | |
1317 | |
1318 /* ------------------------------------------------------------ */ | |
1319 /** | |
1320 * Sets the "context path" for this request | 1297 * Sets the "context path" for this request |
1321 * | 1298 * |
1322 * @see HttpServletRequest#getContextPath() | 1299 * @see HttpServletRequest#getContextPath() |
1323 */ | 1300 */ |
1324 public void setContextPath(String contextPath) | 1301 public void setContextPath(String contextPath) |