FileDocCategorySizeDatePackage
ServletRequestWrapper.javaAPI DocApache Tomcat 6.0.149433Fri Jul 20 04:20:36 BST 2007javax.servlet

ServletRequestWrapper

public class ServletRequestWrapper extends Object implements ServletRequest
Provides a convenient implementation of the ServletRequest interface that can be subclassed by developers wishing to adapt the request to a Servlet. This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped request object.
since
v 2.3
see
javax.servlet.ServletRequest

Fields Summary
private ServletRequest
request
Constructors Summary
public ServletRequestWrapper(ServletRequest request)
Creates a ServletRequest adaptor wrapping the given request object.

throws
java.lang.IllegalArgumentException if the request is null

	if (request == null) {
	    throw new IllegalArgumentException("Request cannot be null");   
	}
	this.request = request;
    
Methods Summary
public java.lang.ObjectgetAttribute(java.lang.String name)
The default behavior of this method is to call getAttribute(String name) on the wrapped request object.

	return this.request.getAttribute(name);
	
public java.util.EnumerationgetAttributeNames()
The default behavior of this method is to return getAttributeNames() on the wrapped request object.

	return this.request.getAttributeNames();
	
public java.lang.StringgetCharacterEncoding()
The default behavior of this method is to return getCharacterEncoding() on the wrapped request object.

	return this.request.getCharacterEncoding();
	
public intgetContentLength()
The default behavior of this method is to return getContentLength() on the wrapped request object.

	return this.request.getContentLength();
    
public java.lang.StringgetContentType()
The default behavior of this method is to return getContentType() on the wrapped request object.

	return this.request.getContentType();
    
public javax.servlet.ServletInputStreamgetInputStream()
The default behavior of this method is to return getInputStream() on the wrapped request object.

	return this.request.getInputStream();
	
public java.lang.StringgetLocalAddr()
The default behavior of this method is to return getLocalAddr() on the wrapped request object.

since
2.4

        return this.request.getLocalAddr();
    
public java.lang.StringgetLocalName()
The default behavior of this method is to return getLocalName() on the wrapped request object.

since
2.4

        return this.request.getLocalName();
    
public intgetLocalPort()
The default behavior of this method is to return getLocalPort() on the wrapped request object.

since
2.4

        return this.request.getLocalPort();
    
public java.util.LocalegetLocale()
The default behavior of this method is to return getLocale() on the wrapped request object.

	return this.request.getLocale();
    
public java.util.EnumerationgetLocales()
The default behavior of this method is to return getLocales() on the wrapped request object.

	return this.request.getLocales();
    
public java.lang.StringgetParameter(java.lang.String name)
The default behavior of this method is to return getParameter(String name) on the wrapped request object.

	return this.request.getParameter(name);
    
public java.util.MapgetParameterMap()
The default behavior of this method is to return getParameterMap() on the wrapped request object.

	return this.request.getParameterMap();
    
public java.util.EnumerationgetParameterNames()
The default behavior of this method is to return getParameterNames() on the wrapped request object.

	return this.request.getParameterNames();
    
public java.lang.String[]getParameterValues(java.lang.String name)
The default behavior of this method is to return getParameterValues(String name) on the wrapped request object.

	return this.request.getParameterValues(name);
	
public java.lang.StringgetProtocol()
The default behavior of this method is to return getProtocol() on the wrapped request object.

	return this.request.getProtocol();
	
public java.io.BufferedReadergetReader()
The default behavior of this method is to return getReader() on the wrapped request object.

	return this.request.getReader();
	
public java.lang.StringgetRealPath(java.lang.String path)
The default behavior of this method is to return getRealPath(String path) on the wrapped request object.

	return this.request.getRealPath(path);
    
public java.lang.StringgetRemoteAddr()
The default behavior of this method is to return getRemoteAddr() on the wrapped request object.

	return this.request.getRemoteAddr();
    
public java.lang.StringgetRemoteHost()
The default behavior of this method is to return getRemoteHost() on the wrapped request object.

	return this.request.getRemoteHost();
    
public intgetRemotePort()
The default behavior of this method is to return getRemotePort() on the wrapped request object.

since
2.4

        return this.request.getRemotePort();
    
public javax.servlet.ServletRequestgetRequest()
Return the wrapped request object.

		return this.request;
	
public javax.servlet.RequestDispatchergetRequestDispatcher(java.lang.String path)
The default behavior of this method is to return getRequestDispatcher(String path) on the wrapped request object.

	return this.request.getRequestDispatcher(path);
    
public java.lang.StringgetScheme()
The default behavior of this method is to return getScheme() on the wrapped request object.

	return this.request.getScheme();
	
public java.lang.StringgetServerName()
The default behavior of this method is to return getServerName() on the wrapped request object.

	return this.request.getServerName();
	
public intgetServerPort()
The default behavior of this method is to return getServerPort() on the wrapped request object.

	return this.request.getServerPort();
	
public booleanisSecure()
The default behavior of this method is to return isSecure() on the wrapped request object.

	return this.request.isSecure();
    
public voidremoveAttribute(java.lang.String name)
The default behavior of this method is to call removeAttribute(String name) on the wrapped request object.

	this.request.removeAttribute(name);
    
public voidsetAttribute(java.lang.String name, java.lang.Object o)
The default behavior of this method is to return setAttribute(String name, Object o) on the wrapped request object.

	this.request.setAttribute(name, o);
    
public voidsetCharacterEncoding(java.lang.String enc)
The default behavior of this method is to set the character encoding on the wrapped request object.

	this.request.setCharacterEncoding(enc);
	
public voidsetRequest(javax.servlet.ServletRequest request)
Sets the request object being wrapped.

throws
java.lang.IllegalArgumentException if the request is null.

	    if (request == null) {
		throw new IllegalArgumentException("Request cannot be null");
	    }
	    this.request = request;