|
|||||||||||||||||||
| 30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| AbstractHttpServletRequestWrapper.java | 0% | 7.7% | 17% | 8.3% |
|
||||||||||||||
| 1 |
/*
|
|
| 2 |
* ========================================================================
|
|
| 3 |
*
|
|
| 4 |
* Copyright 2001-2004 The Apache Software Foundation.
|
|
| 5 |
*
|
|
| 6 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
| 7 |
* you may not use this file except in compliance with the License.
|
|
| 8 |
* You may obtain a copy of the License at
|
|
| 9 |
*
|
|
| 10 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
| 11 |
*
|
|
| 12 |
* Unless required by applicable law or agreed to in writing, software
|
|
| 13 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
| 14 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
| 15 |
* See the License for the specific language governing permissions and
|
|
| 16 |
* limitations under the License.
|
|
| 17 |
*
|
|
| 18 |
* ========================================================================
|
|
| 19 |
*/
|
|
| 20 |
package org.apache.cactus.server;
|
|
| 21 |
|
|
| 22 |
import java.io.BufferedReader;
|
|
| 23 |
import java.io.File;
|
|
| 24 |
import java.io.IOException;
|
|
| 25 |
|
|
| 26 |
import java.security.Principal;
|
|
| 27 |
|
|
| 28 |
import java.util.Enumeration;
|
|
| 29 |
import java.util.Locale;
|
|
| 30 |
|
|
| 31 |
import javax.servlet.RequestDispatcher;
|
|
| 32 |
import javax.servlet.ServletInputStream;
|
|
| 33 |
import javax.servlet.http.Cookie;
|
|
| 34 |
import javax.servlet.http.HttpServletRequest;
|
|
| 35 |
import javax.servlet.http.HttpSession;
|
|
| 36 |
|
|
| 37 |
import org.apache.cactus.ServletURL;
|
|
| 38 |
import org.apache.commons.logging.Log;
|
|
| 39 |
import org.apache.commons.logging.LogFactory;
|
|
| 40 |
|
|
| 41 |
/**
|
|
| 42 |
* Abstract wrapper around {@link HttpServletRequest}. This class provides
|
|
| 43 |
* a common implementation of the wrapper for the different Servlet APIs.
|
|
| 44 |
* This is an implementation that delegates all the call to the
|
|
| 45 |
* {@link HttpServletRequest} object passed in the constructor except for
|
|
| 46 |
* some overidden methods which are use to simulate a URL. This is to be able
|
|
| 47 |
* to simulate any URL that would have been used to call the test method : if
|
|
| 48 |
* this was not done, the URL that would be returned (by calling the
|
|
| 49 |
* {@link HttpServletRequest#getRequestURI()} method or others alike) would be
|
|
| 50 |
* the URL of the Cactus redirector servlet and not a URL that the test case
|
|
| 51 |
* want to simulate.
|
|
| 52 |
*
|
|
| 53 |
* @version $Id: AbstractHttpServletRequestWrapper.java 238993 2004-05-22 16:39:34Z vmassol $
|
|
| 54 |
*/
|
|
| 55 |
public abstract class AbstractHttpServletRequestWrapper |
|
| 56 |
implements HttpServletRequest
|
|
| 57 |
{
|
|
| 58 |
/**
|
|
| 59 |
* The logger
|
|
| 60 |
*/
|
|
| 61 |
private static final Log LOGGER = |
|
| 62 |
LogFactory.getLog(AbstractHttpServletRequestWrapper.class);
|
|
| 63 |
|
|
| 64 |
/**
|
|
| 65 |
* The real HTTP request
|
|
| 66 |
*/
|
|
| 67 |
protected HttpServletRequest request;
|
|
| 68 |
|
|
| 69 |
/**
|
|
| 70 |
* The URL to simulate
|
|
| 71 |
*/
|
|
| 72 |
protected ServletURL url;
|
|
| 73 |
|
|
| 74 |
/**
|
|
| 75 |
* Remote IP address to simulate (if any)
|
|
| 76 |
* @see #setRemoteIPAddress(String)
|
|
| 77 |
*/
|
|
| 78 |
protected String remoteIPAddress;
|
|
| 79 |
|
|
| 80 |
/**
|
|
| 81 |
* Remote Host name to simulate (if any)
|
|
| 82 |
* @see #setRemoteHostName(String)
|
|
| 83 |
*/
|
|
| 84 |
protected String remoteHostName;
|
|
| 85 |
|
|
| 86 |
/**
|
|
| 87 |
* Remote user to simulate (if any)
|
|
| 88 |
* @see #setRemoteUser(String)
|
|
| 89 |
*/
|
|
| 90 |
protected String remoteUser;
|
|
| 91 |
|
|
| 92 |
// New methods not in the interface --------------------------------------
|
|
| 93 |
|
|
| 94 |
/**
|
|
| 95 |
* Construct an <code>HttpServletRequest</code> instance that delegates
|
|
| 96 |
* it's method calls to the request object passed as parameter and that
|
|
| 97 |
* uses the URL passed as parameter to simulate a URL from which the request
|
|
| 98 |
* would come from.
|
|
| 99 |
*
|
|
| 100 |
* @param theRequest the real HTTP request
|
|
| 101 |
* @param theURL the URL to simulate or <code>null</code> if none
|
|
| 102 |
*/
|
|
| 103 | 24 |
public AbstractHttpServletRequestWrapper(HttpServletRequest theRequest,
|
| 104 |
ServletURL theURL) |
|
| 105 |
{
|
|
| 106 | 24 |
this.request = theRequest;
|
| 107 | 24 |
this.url = theURL;
|
| 108 |
} |
|
| 109 |
|
|
| 110 |
/**
|
|
| 111 |
* @return the original request object
|
|
| 112 |
*/
|
|
| 113 | 2 |
public HttpServletRequest getOriginalRequest()
|
| 114 |
{
|
|
| 115 | 2 |
return this.request; |
| 116 |
} |
|
| 117 |
|
|
| 118 |
/**
|
|
| 119 |
* Simulates the remote IP address (ie the client IP address).
|
|
| 120 |
*
|
|
| 121 |
* @param theRemoteIPAddress the simulated IP address in string format.
|
|
| 122 |
* Exemple : "127.0.0.1"
|
|
| 123 |
*/
|
|
| 124 | 0 |
public void setRemoteIPAddress(String theRemoteIPAddress) |
| 125 |
{
|
|
| 126 | 0 |
this.remoteIPAddress = theRemoteIPAddress;
|
| 127 |
} |
|
| 128 |
|
|
| 129 |
/**
|
|
| 130 |
* Simulates the remote host name(ie the client host name).
|
|
| 131 |
*
|
|
| 132 |
* @param theRemoteHostName the simulated host name in string format.
|
|
| 133 |
* Exemple : "atlantis"
|
|
| 134 |
*/
|
|
| 135 | 0 |
public void setRemoteHostName(String theRemoteHostName) |
| 136 |
{
|
|
| 137 | 0 |
this.remoteHostName = theRemoteHostName;
|
| 138 |
} |
|
| 139 |
|
|
| 140 |
/**
|
|
| 141 |
* Sets the remote user name to simulate.
|
|
| 142 |
*
|
|
| 143 |
* @param theRemoteUser the simulated remote user name
|
|
| 144 |
*/
|
|
| 145 | 0 |
public void setRemoteUser(String theRemoteUser) |
| 146 |
{
|
|
| 147 | 0 |
this.remoteUser = theRemoteUser;
|
| 148 |
} |
|
| 149 |
|
|
| 150 |
// Modified methods ------------------------------------------------------
|
|
| 151 |
|
|
| 152 |
/**
|
|
| 153 |
* @return the context path from the simulated URL or the real context path
|
|
| 154 |
* if a simulation URL has not been defined. The real context path
|
|
| 155 |
* will be returned if the context path defined in the simulated
|
|
| 156 |
* URL has a null value.
|
|
| 157 |
*/
|
|
| 158 | 0 |
public String getContextPath()
|
| 159 |
{
|
|
| 160 | 0 |
String result = this.request.getContextPath();
|
| 161 |
|
|
| 162 | 0 |
if ((this.url != null) && (this.url.getContextPath() != null)) |
| 163 |
{
|
|
| 164 | 0 |
result = this.url.getContextPath();
|
| 165 | 0 |
LOGGER.debug("Using simulated context : [" + result + "]"); |
| 166 |
} |
|
| 167 |
|
|
| 168 | 0 |
return result;
|
| 169 |
} |
|
| 170 |
|
|
| 171 |
/**
|
|
| 172 |
* @return the path info from the simulated URL or the real path info
|
|
| 173 |
* if a simulation URL has not been defined.
|
|
| 174 |
*/
|
|
| 175 | 0 |
public String getPathInfo()
|
| 176 |
{
|
|
| 177 | 0 |
String result; |
| 178 |
|
|
| 179 | 0 |
if (this.url != null) |
| 180 |
{
|
|
| 181 | 0 |
result = this.url.getPathInfo();
|
| 182 | 0 |
LOGGER.debug("Using simulated PathInfo : [" + result + "]"); |
| 183 |
} |
|
| 184 |
else
|
|
| 185 |
{
|
|
| 186 | 0 |
result = this.request.getPathInfo();
|
| 187 |
} |
|
| 188 |
|
|
| 189 | 0 |
return result;
|
| 190 |
} |
|
| 191 |
|
|
| 192 |
/**
|
|
| 193 |
* @return the server name from the simulated URL or the real server name
|
|
| 194 |
* if a simulation URL has not been defined. If the server name
|
|
| 195 |
* defined in the simulation URL is null, return the real server
|
|
| 196 |
* name.
|
|
| 197 |
*/
|
|
| 198 | 0 |
public String getServerName()
|
| 199 |
{
|
|
| 200 | 0 |
String result = this.request.getServerName();
|
| 201 |
|
|
| 202 | 0 |
if ((this.url != null) && (this.url.getHost() != null)) |
| 203 |
{
|
|
| 204 | 0 |
result = this.url.getHost();
|
| 205 | 0 |
LOGGER.debug("Using simulated server name : [" + result + "]"); |
| 206 |
} |
|
| 207 |
|
|
| 208 | 0 |
return result;
|
| 209 |
} |
|
| 210 |
|
|
| 211 |
/**
|
|
| 212 |
* @return the server port number from the simulated URL or the real server
|
|
| 213 |
* port number if a simulation URL has not been defined. If no
|
|
| 214 |
* port is defined in the simulation URL, then port 80 is returned.
|
|
| 215 |
* If the server name has been defined with a null value in
|
|
| 216 |
* in the simulation URL, return the real server port.
|
|
| 217 |
*/
|
|
| 218 | 0 |
public int getServerPort() |
| 219 |
{
|
|
| 220 | 0 |
int result = this.request.getServerPort(); |
| 221 |
|
|
| 222 | 0 |
if ((this.url != null) && (this.url.getServerName() != null)) |
| 223 |
{
|
|
| 224 | 0 |
result = (this.url.getPort() == -1) ? 80 : this.url.getPort(); |
| 225 | 0 |
LOGGER.debug("Using simulated server port : [" + result + "]"); |
| 226 |
} |
|
| 227 |
|
|
| 228 | 0 |
return result;
|
| 229 |
} |
|
| 230 |
|
|
| 231 |
/**
|
|
| 232 |
* @return the URI from the simulated URL or the real URI
|
|
| 233 |
* if a simulation URL has not been defined.
|
|
| 234 |
*/
|
|
| 235 | 0 |
public String getRequestURI()
|
| 236 |
{
|
|
| 237 | 0 |
String result; |
| 238 |
|
|
| 239 | 0 |
if (this.url != null) |
| 240 |
{
|
|
| 241 | 0 |
result = getContextPath() |
| 242 | 0 |
+ ((getServletPath() == null) ? "" : getServletPath()) |
| 243 | 0 |
+ ((getPathInfo() == null) ? "" : getPathInfo()); |
| 244 |
|
|
| 245 | 0 |
LOGGER.debug("Using simulated request URI : [" + result + "]"); |
| 246 |
} |
|
| 247 |
else
|
|
| 248 |
{
|
|
| 249 | 0 |
result = this.request.getRequestURI();
|
| 250 |
} |
|
| 251 |
|
|
| 252 | 0 |
return result;
|
| 253 |
} |
|
| 254 |
|
|
| 255 |
/**
|
|
| 256 |
* @return the servlet path from the simulated URL or the real servlet path
|
|
| 257 |
* if a simulation URL has not been defined. The real servlet path
|
|
| 258 |
* will be returned if the servlet path defined in the simulated
|
|
| 259 |
* URL has a null value.
|
|
| 260 |
*/
|
|
| 261 | 0 |
public String getServletPath()
|
| 262 |
{
|
|
| 263 | 0 |
String result = this.request.getServletPath();
|
| 264 |
|
|
| 265 | 0 |
if ((this.url != null) && (this.url.getServletPath() != null)) |
| 266 |
{
|
|
| 267 | 0 |
result = this.url.getServletPath();
|
| 268 | 0 |
LOGGER.debug("Using simulated servlet path : [" + result + "]"); |
| 269 |
} |
|
| 270 |
|
|
| 271 | 0 |
return result;
|
| 272 |
} |
|
| 273 |
|
|
| 274 |
/**
|
|
| 275 |
* @return any extra path information after the servlet name but
|
|
| 276 |
* before the query string, and translates it to a real path.
|
|
| 277 |
* Takes into account the simulated URL (if any).
|
|
| 278 |
*/
|
|
| 279 | 0 |
public String getPathTranslated()
|
| 280 |
{
|
|
| 281 | 0 |
String pathTranslated; |
| 282 |
|
|
| 283 | 0 |
if ((this.url != null) && (this.url.getPathInfo() != null)) |
| 284 |
{
|
|
| 285 | 0 |
String pathInfo = this.url.getPathInfo();
|
| 286 |
|
|
| 287 |
// If getRealPath returns null then getPathTranslated should also
|
|
| 288 |
// return null (see section SRV.4.5 of the Servlet 2.3 spec).
|
|
| 289 | 0 |
if (this.request.getRealPath("/") == null) |
| 290 |
{
|
|
| 291 | 0 |
pathTranslated = null;
|
| 292 |
} |
|
| 293 |
else
|
|
| 294 |
{
|
|
| 295 |
// Compute the translated path using the root real path
|
|
| 296 | 0 |
String newPathInfo = (pathInfo.startsWith("/")
|
| 297 |
? pathInfo.substring(1) : pathInfo); |
|
| 298 |
|
|
| 299 | 0 |
if (this.request.getRealPath("/").endsWith("/")) |
| 300 |
{
|
|
| 301 | 0 |
pathTranslated = this.request.getRealPath("/") |
| 302 |
+ newPathInfo.replace('/', File.separatorChar);
|
|
| 303 |
} |
|
| 304 |
else
|
|
| 305 |
{
|
|
| 306 | 0 |
pathTranslated = this.request.getRealPath("/") |
| 307 |
+ File.separatorChar + newPathInfo.replace('/',
|
|
| 308 |
File.separatorChar); |
|
| 309 |
} |
|
| 310 |
} |
|
| 311 |
} |
|
| 312 |
else
|
|
| 313 |
{
|
|
| 314 | 0 |
pathTranslated = this.request.getPathTranslated();
|
| 315 |
} |
|
| 316 |
|
|
| 317 | 0 |
return pathTranslated;
|
| 318 |
} |
|
| 319 |
|
|
| 320 |
/**
|
|
| 321 |
* @return the query string from the simulated URL or the real query
|
|
| 322 |
* string if a simulation URL has not been defined.
|
|
| 323 |
*/
|
|
| 324 | 0 |
public String getQueryString()
|
| 325 |
{
|
|
| 326 | 0 |
String result; |
| 327 |
|
|
| 328 | 0 |
if (this.url != null) |
| 329 |
{
|
|
| 330 | 0 |
result = this.url.getQueryString();
|
| 331 | 0 |
LOGGER.debug("Using simulated query string : [" + result + "]"); |
| 332 |
} |
|
| 333 |
else
|
|
| 334 |
{
|
|
| 335 | 0 |
result = this.request.getQueryString();
|
| 336 |
} |
|
| 337 |
|
|
| 338 | 0 |
return result;
|
| 339 |
} |
|
| 340 |
|
|
| 341 |
/**
|
|
| 342 |
* @param thePath the path to the resource
|
|
| 343 |
* @return a wrapped request dispatcher instead of the real one, so that
|
|
| 344 |
* forward() and include() calls will use the wrapped dispatcher
|
|
| 345 |
* passing it the *original* request [this is needed for some
|
|
| 346 |
* servlet engine like Tomcat 3.x which do not support the new
|
|
| 347 |
* mechanism introduced by Servlet 2.3 Filters].
|
|
| 348 |
* @see HttpServletRequest#getRequestDispatcher(String)
|
|
| 349 |
*/
|
|
| 350 | 0 |
public RequestDispatcher getRequestDispatcher(String thePath)
|
| 351 |
{
|
|
| 352 |
// I hate it, but we have to write some logic here ! Ideally we
|
|
| 353 |
// shouldn't have to do this as it is supposed to be done by the servlet
|
|
| 354 |
// engine. However as we are simulating the request URL, we have to
|
|
| 355 |
// provide it ... This is where we can see the limitation of Cactus
|
|
| 356 |
// (it has to mock some parts of the servlet engine) !
|
|
| 357 | 0 |
if (thePath == null) |
| 358 |
{
|
|
| 359 | 0 |
return null; |
| 360 |
} |
|
| 361 |
|
|
| 362 | 0 |
RequestDispatcher dispatcher = null;
|
| 363 | 0 |
String fullPath; |
| 364 |
|
|
| 365 |
// The spec says that the path can be relative, in which case it will
|
|
| 366 |
// be relative to the request. So for relative paths, we need to take
|
|
| 367 |
// into account the simulated URL (ServletURL).
|
|
| 368 | 0 |
if (thePath.startsWith("/")) |
| 369 |
{
|
|
| 370 | 0 |
fullPath = thePath; |
| 371 |
} |
|
| 372 |
else
|
|
| 373 |
{
|
|
| 374 | 0 |
String pI = getPathInfo(); |
| 375 |
|
|
| 376 | 0 |
if (pI == null) |
| 377 |
{
|
|
| 378 | 0 |
fullPath = catPath(getServletPath(), thePath); |
| 379 |
} |
|
| 380 |
else
|
|
| 381 |
{
|
|
| 382 | 0 |
fullPath = catPath(getServletPath() + pI, thePath); |
| 383 |
} |
|
| 384 |
|
|
| 385 | 0 |
if (fullPath == null) |
| 386 |
{
|
|
| 387 | 0 |
return null; |
| 388 |
} |
|
| 389 |
} |
|
| 390 |
|
|
| 391 | 0 |
LOGGER.debug("Computed full path : [" + fullPath + "]"); |
| 392 |
|
|
| 393 | 0 |
dispatcher = new RequestDispatcherWrapper(
|
| 394 |
this.request.getRequestDispatcher(fullPath));
|
|
| 395 |
|
|
| 396 | 0 |
return dispatcher;
|
| 397 |
} |
|
| 398 |
|
|
| 399 |
/**
|
|
| 400 |
* Will concatenate 2 paths, normalising it. For example :
|
|
| 401 |
* ( /a/b/c + d = /a/b/d, /a/b/c + ../d = /a/d ). Code borrowed from
|
|
| 402 |
* Tomcat 3.2.2 !
|
|
| 403 |
*
|
|
| 404 |
* @param theLookupPath the first part of the path
|
|
| 405 |
* @param thePath the part to add to the lookup path
|
|
| 406 |
* @return the concatenated thePath or null if an error occurs
|
|
| 407 |
*/
|
|
| 408 | 0 |
private String catPath(String theLookupPath, String thePath)
|
| 409 |
{
|
|
| 410 |
// Cut off the last slash and everything beyond
|
|
| 411 | 0 |
int index = theLookupPath.lastIndexOf("/"); |
| 412 |
|
|
| 413 | 0 |
theLookupPath = theLookupPath.substring(0, index); |
| 414 |
|
|
| 415 |
// Deal with .. by chopping dirs off the lookup thePath
|
|
| 416 | 0 |
while (thePath.startsWith("../")) |
| 417 |
{
|
|
| 418 | 0 |
if (theLookupPath.length() > 0)
|
| 419 |
{
|
|
| 420 | 0 |
index = theLookupPath.lastIndexOf("/");
|
| 421 | 0 |
theLookupPath = theLookupPath.substring(0, index); |
| 422 |
} |
|
| 423 |
else
|
|
| 424 |
{
|
|
| 425 |
// More ..'s than dirs, return null
|
|
| 426 | 0 |
return null; |
| 427 |
} |
|
| 428 |
|
|
| 429 | 0 |
index = thePath.indexOf("../") + 3;
|
| 430 | 0 |
thePath = thePath.substring(index); |
| 431 |
} |
|
| 432 |
|
|
| 433 | 0 |
return theLookupPath + "/" + thePath; |
| 434 |
} |
|
| 435 |
|
|
| 436 |
/**
|
|
| 437 |
* @return the simulated remote IP address if any or the real one.
|
|
| 438 |
*
|
|
| 439 |
* @see HttpServletRequest#getRemoteAddr()
|
|
| 440 |
*/
|
|
| 441 | 0 |
public String getRemoteAddr()
|
| 442 |
{
|
|
| 443 | 0 |
String remoteIPAddress; |
| 444 |
|
|
| 445 | 0 |
if (this.remoteIPAddress != null) |
| 446 |
{
|
|
| 447 | 0 |
remoteIPAddress = this.remoteIPAddress;
|
| 448 |
} |
|
| 449 |
else
|
|
| 450 |
{
|
|
| 451 | 0 |
remoteIPAddress = this.request.getRemoteAddr();
|
| 452 |
} |
|
| 453 |
|
|
| 454 | 0 |
return remoteIPAddress;
|
| 455 |
} |
|
| 456 |
|
|
| 457 |
/**
|
|
| 458 |
* @return the simulated remote host name if any or the real one.
|
|
| 459 |
*
|
|
| 460 |
* @see HttpServletRequest#getRemoteHost()
|
|
| 461 |
*/
|
|
| 462 | 0 |
public String getRemoteHost()
|
| 463 |
{
|
|
| 464 | 0 |
String remoteHostName; |
| 465 |
|
|
| 466 | 0 |
if (this.remoteHostName != null) |
| 467 |
{
|
|
| 468 | 0 |
remoteHostName = this.remoteHostName;
|
| 469 |
} |
|
| 470 |
else
|
|
| 471 |
{
|
|
| 472 | 0 |
remoteHostName = this.request.getRemoteHost();
|
| 473 |
} |
|
| 474 |
|
|
| 475 | 0 |
return remoteHostName;
|
| 476 |
} |
|
| 477 |
|
|
| 478 |
/**
|
|
| 479 |
* @return the simulated remote user name if any or the real one.
|
|
| 480 |
*
|
|
| 481 |
* @see HttpServletRequest#getRemoteUser()
|
|
| 482 |
*/
|
|
| 483 | 0 |
public String getRemoteUser()
|
| 484 |
{
|
|
| 485 | 0 |
String remoteUser; |
| 486 |
|
|
| 487 | 0 |
if (this.remoteUser != null) |
| 488 |
{
|
|
| 489 | 0 |
remoteUser = this.remoteUser;
|
| 490 |
} |
|
| 491 |
else
|
|
| 492 |
{
|
|
| 493 | 0 |
remoteUser = this.request.getRemoteUser();
|
| 494 |
} |
|
| 495 |
|
|
| 496 | 0 |
return remoteUser;
|
| 497 |
} |
|
| 498 |
|
|
| 499 |
// Not modified methods --------------------------------------------------
|
|
| 500 |
|
|
| 501 |
/**
|
|
| 502 |
* @see HttpServletRequest#isRequestedSessionIdFromURL()
|
|
| 503 |
*/
|
|
| 504 | 0 |
public boolean isRequestedSessionIdFromURL() |
| 505 |
{
|
|
| 506 | 0 |
return this.request.isRequestedSessionIdFromURL(); |
| 507 |
} |
|
| 508 |
|
|
| 509 |
/**
|
|
| 510 |
* @see HttpServletRequest#isRequestedSessionIdFromUrl()
|
|
| 511 |
*/
|
|
| 512 | 0 |
public boolean isRequestedSessionIdFromUrl() |
| 513 |
{
|
|
| 514 | 0 |
return this.request.isRequestedSessionIdFromURL(); |
| 515 |
} |
|
| 516 |
|
|
| 517 |
/**
|
|
| 518 |
* @see HttpServletRequest#isUserInRole(String)
|
|
| 519 |
*/
|
|
| 520 | 0 |
public boolean isUserInRole(String theRole) |
| 521 |
{
|
|
| 522 | 0 |
return this.request.isUserInRole(theRole); |
| 523 |
} |
|
| 524 |
|
|
| 525 |
/**
|
|
| 526 |
* @see HttpServletRequest#isRequestedSessionIdValid()
|
|
| 527 |
*/
|
|
| 528 | 0 |
public boolean isRequestedSessionIdValid() |
| 529 |
{
|
|
| 530 | 0 |
return this.request.isRequestedSessionIdValid(); |
| 531 |
} |
|
| 532 |
|
|
| 533 |
/**
|
|
| 534 |
* @see HttpServletRequest#isRequestedSessionIdFromCookie()
|
|
| 535 |
*/
|
|
| 536 | 0 |
public boolean isRequestedSessionIdFromCookie() |
| 537 |
{
|
|
| 538 | 0 |
return this.request.isRequestedSessionIdFromCookie(); |
| 539 |
} |
|
| 540 |
|
|
| 541 |
/**
|
|
| 542 |
* @see HttpServletRequest#getLocales()
|
|
| 543 |
*/
|
|
| 544 | 0 |
public Enumeration getLocales()
|
| 545 |
{
|
|
| 546 | 0 |
return this.request.getLocales(); |
| 547 |
} |
|
| 548 |
|
|
| 549 |
/**
|
|
| 550 |
* @see HttpServletRequest#getHeader(String)
|
|
| 551 |
*/
|
|
| 552 | 1 |
public String getHeader(String theName)
|
| 553 |
{
|
|
| 554 | 1 |
return this.request.getHeader(theName); |
| 555 |
} |
|
| 556 |
|
|
| 557 |
/**
|
|
| 558 |
* @see HttpServletRequest#getHeaders(String)
|
|
| 559 |
*/
|
|
| 560 | 0 |
public Enumeration getHeaders(String theName)
|
| 561 |
{
|
|
| 562 | 0 |
return this.request.getHeaders(theName); |
| 563 |
} |
|
| 564 |
|
|
| 565 |
/**
|
|
| 566 |
* @see HttpServletRequest#getHeaderNames()
|
|
| 567 |
*/
|
|
| 568 | 0 |
public Enumeration getHeaderNames()
|
| 569 |
{
|
|
| 570 | 0 |
return this.request.getHeaderNames(); |
| 571 |
} |
|
| 572 |
|
|
| 573 |
/**
|
|
| 574 |
* @see HttpServletRequest#getScheme()
|
|
| 575 |
*/
|
|
| 576 | 0 |
public String getScheme()
|
| 577 |
{
|
|
| 578 | 0 |
return this.request.getScheme(); |
| 579 |
} |
|
| 580 |
|
|
| 581 |
/**
|
|
| 582 |
* @see HttpServletRequest#getAuthType()
|
|
| 583 |
*/
|
|
| 584 | 0 |
public String getAuthType()
|
| 585 |
{
|
|
| 586 | 0 |
return this.request.getAuthType(); |
| 587 |
} |
|
| 588 |
|
|
| 589 |
/**
|
|
| 590 |
* @see HttpServletRequest#getRealPath(String)
|
|
| 591 |
*/
|
|
| 592 | 0 |
public String getRealPath(String thePath)
|
| 593 |
{
|
|
| 594 | 0 |
return this.request.getRealPath(thePath); |
| 595 |
} |
|
| 596 |
|
|
| 597 |
/**
|
|
| 598 |
* @see HttpServletRequest#getSession()
|
|
| 599 |
*/
|
|
| 600 | 0 |
public HttpSession getSession()
|
| 601 |
{
|
|
| 602 | 0 |
return this.request.getSession(); |
| 603 |
} |
|
| 604 |
|
|
| 605 |
/**
|
|
| 606 |
* @see HttpServletRequest#getSession(boolean)
|
|
| 607 |
*/
|
|
| 608 | 1 |
public HttpSession getSession(boolean isCreate) |
| 609 |
{
|
|
| 610 | 1 |
return this.request.getSession(isCreate); |
| 611 |
} |
|
| 612 |
|
|
| 613 |
/**
|
|
| 614 |
* @see HttpServletRequest#getReader()
|
|
| 615 |
*/
|
|
| 616 | 0 |
public BufferedReader getReader() throws IOException |
| 617 |
{
|
|
| 618 | 0 |
return this.request.getReader(); |
| 619 |
} |
|
| 620 |
|
|
| 621 |
/**
|
|
| 622 |
* @see HttpServletRequest#getContentLength()
|
|
| 623 |
*/
|
|
| 624 | 0 |
public int getContentLength() |
| 625 |
{
|
|
| 626 | 0 |
return this.request.getContentLength(); |
| 627 |
} |
|
| 628 |
|
|
| 629 |
/**
|
|
| 630 |
* @see HttpServletRequest#getParameterValues(String)
|
|
| 631 |
*/
|
|
| 632 | 0 |
public String[] getParameterValues(String theName)
|
| 633 |
{
|
|
| 634 | 0 |
return this.request.getParameterValues(theName); |
| 635 |
} |
|
| 636 |
|
|
| 637 |
/**
|
|
| 638 |
* @see HttpServletRequest#getContentType()
|
|
| 639 |
*/
|
|
| 640 | 0 |
public String getContentType()
|
| 641 |
{
|
|
| 642 | 0 |
return this.request.getContentType(); |
| 643 |
} |
|
| 644 |
|
|
| 645 |
/**
|
|
| 646 |
* @see HttpServletRequest#getLocale()
|
|
| 647 |
*/
|
|
| 648 | 0 |
public Locale getLocale()
|
| 649 |
{
|
|
| 650 | 0 |
return this.request.getLocale(); |
| 651 |
} |
|
| 652 |
|
|
| 653 |
/**
|
|
| 654 |
* @see HttpServletRequest#removeAttribute(String)
|
|
| 655 |
*/
|
|
| 656 | 0 |
public void removeAttribute(String theName) |
| 657 |
{
|
|
| 658 | 0 |
this.request.removeAttribute(theName);
|
| 659 |
} |
|
| 660 |
|
|
| 661 |
/**
|
|
| 662 |
* @see HttpServletRequest#getParameter(String)
|
|
| 663 |
*/
|
|
| 664 | 3 |
public String getParameter(String theName)
|
| 665 |
{
|
|
| 666 | 3 |
return this.request.getParameter(theName); |
| 667 |
} |
|
| 668 |
|
|
| 669 |
/**
|
|
| 670 |
* @see HttpServletRequest#getInputStream()
|
|
| 671 |
*/
|
|
| 672 | 0 |
public ServletInputStream getInputStream() throws IOException |
| 673 |
{
|
|
| 674 | 0 |
return this.request.getInputStream(); |
| 675 |
} |
|
| 676 |
|
|
| 677 |
/**
|
|
| 678 |
* @see HttpServletRequest#getUserPrincipal()
|
|
| 679 |
*/
|
|
| 680 | 0 |
public Principal getUserPrincipal()
|
| 681 |
{
|
|
| 682 | 0 |
return this.request.getUserPrincipal(); |
| 683 |
} |
|
| 684 |
|
|
| 685 |
/**
|
|
| 686 |
* @see HttpServletRequest#isSecure()
|
|
| 687 |
*/
|
|
| 688 | 0 |
public boolean isSecure() |
| 689 |
{
|
|
| 690 | 0 |
return this.request.isSecure(); |
| 691 |
} |
|
| 692 |
|
|
| 693 |
/**
|
|
| 694 |
* @see HttpServletRequest#getCharacterEncoding()
|
|
| 695 |
*/
|
|
| 696 | 0 |
public String getCharacterEncoding()
|
| 697 |
{
|
|
| 698 | 0 |
return this.request.getCharacterEncoding(); |
| 699 |
} |
|
| 700 |
|
|
| 701 |
/**
|
|
| 702 |
* @see HttpServletRequest#getParameterNames()
|
|
| 703 |
*/
|
|
| 704 | 0 |
public Enumeration getParameterNames()
|
| 705 |
{
|
|
| 706 | 0 |
return this.request.getParameterNames(); |
| 707 |
} |
|
| 708 |
|
|
| 709 |
/**
|
|
| 710 |
* @see HttpServletRequest#getMethod()
|
|
| 711 |
*/
|
|
| 712 | 2 |
public String getMethod()
|
| 713 |
{
|
|
| 714 | 2 |
return this.request.getMethod(); |
| 715 |
} |
|
| 716 |
|
|
| 717 |
/**
|
|
| 718 |
* @see HttpServletRequest#setAttribute(String, Object)
|
|
| 719 |
*/
|
|
| 720 | 1 |
public void setAttribute(String theName, Object theAttribute) |
| 721 |
{
|
|
| 722 | 1 |
this.request.setAttribute(theName, theAttribute);
|
| 723 |
} |
|
| 724 |
|
|
| 725 |
/**
|
|
| 726 |
* @see HttpServletRequest#getAttribute(String)
|
|
| 727 |
*/
|
|
| 728 | 1 |
public Object getAttribute(String theName)
|
| 729 |
{
|
|
| 730 | 1 |
return this.request.getAttribute(theName); |
| 731 |
} |
|
| 732 |
|
|
| 733 |
/**
|
|
| 734 |
* @see HttpServletRequest#getIntHeader(String)
|
|
| 735 |
*/
|
|
| 736 | 0 |
public int getIntHeader(String theName) |
| 737 |
{
|
|
| 738 | 0 |
return this.request.getIntHeader(theName); |
| 739 |
} |
|
| 740 |
|
|
| 741 |
/**
|
|
| 742 |
* @see HttpServletRequest#getDateHeader(String)
|
|
| 743 |
*/
|
|
| 744 | 0 |
public long getDateHeader(String theName) |
| 745 |
{
|
|
| 746 | 0 |
return this.request.getDateHeader(theName); |
| 747 |
} |
|
| 748 |
|
|
| 749 |
/**
|
|
| 750 |
* @see HttpServletRequest#getAttributeNames()
|
|
| 751 |
*/
|
|
| 752 | 0 |
public Enumeration getAttributeNames()
|
| 753 |
{
|
|
| 754 | 0 |
return this.request.getAttributeNames(); |
| 755 |
} |
|
| 756 |
|
|
| 757 |
/**
|
|
| 758 |
* @see HttpServletRequest#getRequestedSessionId()
|
|
| 759 |
*/
|
|
| 760 | 0 |
public String getRequestedSessionId()
|
| 761 |
{
|
|
| 762 | 0 |
return this.request.getRequestedSessionId(); |
| 763 |
} |
|
| 764 |
|
|
| 765 |
/**
|
|
| 766 |
* @see HttpServletRequest#getCookies()
|
|
| 767 |
*/
|
|
| 768 | 2 |
public Cookie[] getCookies()
|
| 769 |
{
|
|
| 770 | 2 |
return this.request.getCookies(); |
| 771 |
} |
|
| 772 |
|
|
| 773 |
/**
|
|
| 774 |
* @see HttpServletRequest#getProtocol()
|
|
| 775 |
*/
|
|
| 776 | 0 |
public String getProtocol()
|
| 777 |
{
|
|
| 778 | 0 |
return this.request.getProtocol(); |
| 779 |
} |
|
| 780 |
} |
|
| 781 |
|
|
||||||||||