Class HttpServletRequestProxy
java.lang.Object
com.ibm.websphere.servlet.request.HttpServletRequestProxy
- All Implemented Interfaces:
- javax.servlet.http.HttpServletRequest,- javax.servlet.ServletRequest
public abstract class HttpServletRequestProxy
extends Object
implements javax.servlet.http.HttpServletRequest
Deprecated.
- 
Field SummaryFields inherited from interface javax.servlet.http.HttpServletRequestBASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiongetAttribute(String name) Deprecated.Deprecated.Deprecated.Deprecated.intDeprecated.Deprecated.Deprecated.javax.servlet.http.Cookie[]Deprecated.longgetDateHeader(String name) Deprecated.Deprecated.Deprecated.getHeaders(String name) Deprecated.javax.servlet.ServletInputStreamDeprecated.intgetIntHeader(String name) Deprecated.Deprecated.Deprecated.Deprecated.getParameter(String name) Deprecated.Deprecated.Deprecated.String[]getParameterValues(String name) Deprecated.Deprecated.Deprecated.Deprecated.Deprecated.Deprecated.getRealPath(String path) Deprecated.Deprecated.Deprecated.Deprecated.javax.servlet.ServletRequestDeprecated.javax.servlet.RequestDispatchergetRequestDispatcher(String path) Deprecated.Deprecated.Deprecated.Deprecated.Deprecated.Deprecated.intDeprecated.Deprecated.javax.servlet.http.HttpSessionDeprecated.javax.servlet.http.HttpSessiongetSession(boolean create) Deprecated.Deprecated.booleanDeprecated.booleanDeprecated.booleanDeprecated.booleanDeprecated.booleanisSecure()Deprecated.booleanisUserInRole(String role) Deprecated.voidremoveAttribute(String name) Deprecated.voidsetAttribute(String key, Object o) Deprecated.voidsetCharacterEncoding(String encoding) Deprecated.Methods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.servlet.http.HttpServletRequestauthenticate, getPart, getParts, login, logoutMethods inherited from interface javax.servlet.ServletRequestgetAsyncContext, getDispatcherType, getLocalAddr, getLocalName, getLocalPort, getRemotePort, getServletContext, isAsyncStarted, isAsyncSupported, startAsync, startAsync
- 
Constructor Details- 
HttpServletRequestProxypublic HttpServletRequestProxy()Deprecated.
 
- 
- 
Method Details- 
getAuthTypeDeprecated.- Specified by:
- getAuthTypein interface- javax.servlet.http.HttpServletRequest
 
- 
getCookiespublic javax.servlet.http.Cookie[] getCookies()Deprecated.- Specified by:
- getCookiesin interface- javax.servlet.http.HttpServletRequest
 
- 
getIntHeaderDeprecated.- Specified by:
- getIntHeaderin interface- javax.servlet.http.HttpServletRequest
 
- 
getDateHeaderDeprecated.- Specified by:
- getDateHeaderin interface- javax.servlet.http.HttpServletRequest
 
- 
getHeaderDeprecated.- Specified by:
- getHeaderin interface- javax.servlet.http.HttpServletRequest
 
- 
getHeaderNamesDeprecated.- Specified by:
- getHeaderNamesin interface- javax.servlet.http.HttpServletRequest
 
- 
getQueryStringDeprecated.- Specified by:
- getQueryStringin interface- javax.servlet.http.HttpServletRequest
 
- 
getMethodDeprecated.- Specified by:
- getMethodin interface- javax.servlet.http.HttpServletRequest
 
- 
getPathInfoDeprecated.- Specified by:
- getPathInfoin interface- javax.servlet.http.HttpServletRequest
 
- 
getPathTranslatedDeprecated.- Specified by:
- getPathTranslatedin interface- javax.servlet.http.HttpServletRequest
 
- 
getServletPathDeprecated.- Specified by:
- getServletPathin interface- javax.servlet.http.HttpServletRequest
 
- 
getRemoteUserDeprecated.- Specified by:
- getRemoteUserin interface- javax.servlet.http.HttpServletRequest
 
- 
getRequestedSessionIdDeprecated.- Specified by:
- getRequestedSessionIdin interface- javax.servlet.http.HttpServletRequest
 
- 
getRequestURIDeprecated.- Specified by:
- getRequestURIin interface- javax.servlet.http.HttpServletRequest
 
- 
isRequestedSessionIdFromCookiepublic boolean isRequestedSessionIdFromCookie()Deprecated.- Specified by:
- isRequestedSessionIdFromCookiein interface- javax.servlet.http.HttpServletRequest
 
- 
getSessionpublic javax.servlet.http.HttpSession getSession(boolean create) Deprecated.- Specified by:
- getSessionin interface- javax.servlet.http.HttpServletRequest
 
- 
getSessionpublic javax.servlet.http.HttpSession getSession()Deprecated.- Specified by:
- getSessionin interface- javax.servlet.http.HttpServletRequest
 
- 
isRequestedSessionIdValidpublic boolean isRequestedSessionIdValid()Deprecated.- Specified by:
- isRequestedSessionIdValidin interface- javax.servlet.http.HttpServletRequest
 
- 
isRequestedSessionIdFromURLpublic boolean isRequestedSessionIdFromURL()Deprecated.- Specified by:
- isRequestedSessionIdFromURLin interface- javax.servlet.http.HttpServletRequest
 
- 
isRequestedSessionIdFromUrlpublic boolean isRequestedSessionIdFromUrl()Deprecated.- Specified by:
- isRequestedSessionIdFromUrlin interface- javax.servlet.http.HttpServletRequest
 
- 
getHeadersDeprecated.- Specified by:
- getHeadersin interface- javax.servlet.http.HttpServletRequest
 
- 
getContextPathDeprecated.- Specified by:
- getContextPathin interface- javax.servlet.http.HttpServletRequest
 
- 
isUserInRoleDeprecated.- Specified by:
- isUserInRolein interface- javax.servlet.http.HttpServletRequest
 
- 
getUserPrincipalDeprecated.- Specified by:
- getUserPrincipalin interface- javax.servlet.http.HttpServletRequest
 
- 
getRequestURLDeprecated.- Specified by:
- getRequestURLin interface- javax.servlet.http.HttpServletRequest
 
- 
getAttributeDeprecated.- Specified by:
- getAttributein interface- javax.servlet.ServletRequest
 
- 
getAttributeNamesDeprecated.- Specified by:
- getAttributeNamesin interface- javax.servlet.ServletRequest
 
- 
getInputStreamDeprecated.- Specified by:
- getInputStreamin interface- javax.servlet.ServletRequest
- Throws:
- IOException
 
- 
getCharacterEncodingDeprecated.- Specified by:
- getCharacterEncodingin interface- javax.servlet.ServletRequest
 
- 
getContentLengthpublic int getContentLength()Deprecated.- Specified by:
- getContentLengthin interface- javax.servlet.ServletRequest
 
- 
getContentTypeDeprecated.- Specified by:
- getContentTypein interface- javax.servlet.ServletRequest
 
- 
getProtocolDeprecated.- Specified by:
- getProtocolin interface- javax.servlet.ServletRequest
 
- 
getParameterDeprecated.- Specified by:
- getParameterin interface- javax.servlet.ServletRequest
 
- 
getParameterNamesDeprecated.- Specified by:
- getParameterNamesin interface- javax.servlet.ServletRequest
 
- 
getParameterValuesDeprecated.- Specified by:
- getParameterValuesin interface- javax.servlet.ServletRequest
 
- 
getSchemeDeprecated.- Specified by:
- getSchemein interface- javax.servlet.ServletRequest
 
- 
getServerNameDeprecated.- Specified by:
- getServerNamein interface- javax.servlet.ServletRequest
 
- 
getServerPortpublic int getServerPort()Deprecated.- Specified by:
- getServerPortin interface- javax.servlet.ServletRequest
 
- 
getRealPathDeprecated.- Specified by:
- getRealPathin interface- javax.servlet.ServletRequest
 
- 
getReaderDeprecated.- Specified by:
- getReaderin interface- javax.servlet.ServletRequest
- Throws:
- IOException
 
- 
getRemoteAddrDeprecated.- Specified by:
- getRemoteAddrin interface- javax.servlet.ServletRequest
 
- 
getRemoteHostDeprecated.- Specified by:
- getRemoteHostin interface- javax.servlet.ServletRequest
 
- 
setAttributeDeprecated.- Specified by:
- setAttributein interface- javax.servlet.ServletRequest
 
- 
removeAttributeDeprecated.- Specified by:
- removeAttributein interface- javax.servlet.ServletRequest
 
- 
getLocaleDeprecated.- Specified by:
- getLocalein interface- javax.servlet.ServletRequest
 
- 
getLocalesDeprecated.- Specified by:
- getLocalesin interface- javax.servlet.ServletRequest
 
- 
isSecurepublic boolean isSecure()Deprecated.- Specified by:
- isSecurein interface- javax.servlet.ServletRequest
 
- 
getRequestDispatcherDeprecated.- Specified by:
- getRequestDispatcherin interface- javax.servlet.ServletRequest
 
- 
getRequestpublic javax.servlet.ServletRequest getRequest()Deprecated.
- 
getParameterMapDeprecated.- Specified by:
- getParameterMapin interface- javax.servlet.ServletRequest
 
- 
setCharacterEncodingDeprecated.- Specified by:
- setCharacterEncodingin interface- javax.servlet.ServletRequest
- Throws:
- UnsupportedEncodingException
 
 
- 
Using the proxied request:
Sample subclass (overloads the request's InputStream)
// This enhanced request will force the request to be a POST request. // This request POST data input will be read from a specified file. public class PostedFileRequest extends HttpServletRequestProxy{ private HttpServletRequest _request; private File _file; public PostedFileRequest(File f, HttpServletRequest req){ _file =f; _request = req; } protected HttpServletRequest getProxiedHttpServletRequest(){ return _request; } //overload request functionality public ServletInputStream getInputStream() throws IOException{ return new ServletInputStreamAdapter(new FileInputStream(_file)); } public BufferedReader getReader() throws IOException{ return new BufferedReader(getInputStream()); } public String getMethod(){ //force the HTTP method to be POST. return "POST"; } }Using the enhanced request subclass transparently in a servlet
//This servlet posts a data file as a request to another servlet. public class PostGeneratorServlet extends HttpServlet{ public void service HttpServletRequest req, HttpServletResponse resp){ req = new PostedFileRequest(req, new File(request.getPathTranslated())); //forward the enhanced request to be used transparently by another servlet. getServletContext().getRequestDispatcher("/postHandlerServlet").forward(req, resp); } }