Class HttpServletRequestProxy
java.lang.Object
com.ibm.websphere.servlet.request.HttpServletRequestProxy
- All Implemented Interfaces:
- jakarta.servlet.http.HttpServletRequest,- jakarta.servlet.ServletRequest
public abstract class HttpServletRequestProxy
extends Object
implements jakarta.servlet.http.HttpServletRequest
Deprecated.
- 
Field SummaryFields inherited from interface jakarta.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.jakarta.servlet.http.Cookie[]Deprecated.longgetDateHeader(String name) Deprecated.Deprecated.Deprecated.getHeaders(String name) Deprecated.jakarta.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.jakarta.servlet.ServletRequestDeprecated.jakarta.servlet.RequestDispatchergetRequestDispatcher(String path) Deprecated.Deprecated.Deprecated.Deprecated.Deprecated.Deprecated.intDeprecated.Deprecated.jakarta.servlet.http.HttpSessionDeprecated.jakarta.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 jakarta.servlet.http.HttpServletRequestauthenticate, getPart, getParts, login, logoutMethods inherited from interface jakarta.servlet.ServletRequestgetAsyncContext, getDispatcherType, getLocalAddr, getLocalName, getLocalPort, getRemotePort, getServletContext, isAsyncStarted, isAsyncSupported, startAsync, startAsync
- 
Constructor Details- 
HttpServletRequestProxypublic HttpServletRequestProxy()Deprecated.
 
- 
- 
Method Details- 
getAuthTypeDeprecated.- Specified by:
- getAuthTypein interface- jakarta.servlet.http.HttpServletRequest
 
- 
getCookiespublic jakarta.servlet.http.Cookie[] getCookies()Deprecated.- Specified by:
- getCookiesin interface- jakarta.servlet.http.HttpServletRequest
 
- 
getIntHeaderDeprecated.- Specified by:
- getIntHeaderin interface- jakarta.servlet.http.HttpServletRequest
 
- 
getDateHeaderDeprecated.- Specified by:
- getDateHeaderin interface- jakarta.servlet.http.HttpServletRequest
 
- 
getHeaderDeprecated.- Specified by:
- getHeaderin interface- jakarta.servlet.http.HttpServletRequest
 
- 
getHeaderNamesDeprecated.- Specified by:
- getHeaderNamesin interface- jakarta.servlet.http.HttpServletRequest
 
- 
getQueryStringDeprecated.- Specified by:
- getQueryStringin interface- jakarta.servlet.http.HttpServletRequest
 
- 
getMethodDeprecated.- Specified by:
- getMethodin interface- jakarta.servlet.http.HttpServletRequest
 
- 
getPathInfoDeprecated.- Specified by:
- getPathInfoin interface- jakarta.servlet.http.HttpServletRequest
 
- 
getPathTranslatedDeprecated.- Specified by:
- getPathTranslatedin interface- jakarta.servlet.http.HttpServletRequest
 
- 
getServletPathDeprecated.- Specified by:
- getServletPathin interface- jakarta.servlet.http.HttpServletRequest
 
- 
getRemoteUserDeprecated.- Specified by:
- getRemoteUserin interface- jakarta.servlet.http.HttpServletRequest
 
- 
getRequestedSessionIdDeprecated.- Specified by:
- getRequestedSessionIdin interface- jakarta.servlet.http.HttpServletRequest
 
- 
getRequestURIDeprecated.- Specified by:
- getRequestURIin interface- jakarta.servlet.http.HttpServletRequest
 
- 
isRequestedSessionIdFromCookiepublic boolean isRequestedSessionIdFromCookie()Deprecated.- Specified by:
- isRequestedSessionIdFromCookiein interface- jakarta.servlet.http.HttpServletRequest
 
- 
getSessionpublic jakarta.servlet.http.HttpSession getSession(boolean create) Deprecated.- Specified by:
- getSessionin interface- jakarta.servlet.http.HttpServletRequest
 
- 
getSessionpublic jakarta.servlet.http.HttpSession getSession()Deprecated.- Specified by:
- getSessionin interface- jakarta.servlet.http.HttpServletRequest
 
- 
isRequestedSessionIdValidpublic boolean isRequestedSessionIdValid()Deprecated.- Specified by:
- isRequestedSessionIdValidin interface- jakarta.servlet.http.HttpServletRequest
 
- 
isRequestedSessionIdFromURLpublic boolean isRequestedSessionIdFromURL()Deprecated.- Specified by:
- isRequestedSessionIdFromURLin interface- jakarta.servlet.http.HttpServletRequest
 
- 
isRequestedSessionIdFromUrlpublic boolean isRequestedSessionIdFromUrl()Deprecated.- Specified by:
- isRequestedSessionIdFromUrlin interface- jakarta.servlet.http.HttpServletRequest
 
- 
getHeadersDeprecated.- Specified by:
- getHeadersin interface- jakarta.servlet.http.HttpServletRequest
 
- 
getContextPathDeprecated.- Specified by:
- getContextPathin interface- jakarta.servlet.http.HttpServletRequest
 
- 
isUserInRoleDeprecated.- Specified by:
- isUserInRolein interface- jakarta.servlet.http.HttpServletRequest
 
- 
getUserPrincipalDeprecated.- Specified by:
- getUserPrincipalin interface- jakarta.servlet.http.HttpServletRequest
 
- 
getRequestURLDeprecated.- Specified by:
- getRequestURLin interface- jakarta.servlet.http.HttpServletRequest
 
- 
getAttributeDeprecated.- Specified by:
- getAttributein interface- jakarta.servlet.ServletRequest
 
- 
getAttributeNamesDeprecated.- Specified by:
- getAttributeNamesin interface- jakarta.servlet.ServletRequest
 
- 
getInputStreamDeprecated.- Specified by:
- getInputStreamin interface- jakarta.servlet.ServletRequest
- Throws:
- IOException
 
- 
getCharacterEncodingDeprecated.- Specified by:
- getCharacterEncodingin interface- jakarta.servlet.ServletRequest
 
- 
getContentLengthpublic int getContentLength()Deprecated.- Specified by:
- getContentLengthin interface- jakarta.servlet.ServletRequest
 
- 
getContentTypeDeprecated.- Specified by:
- getContentTypein interface- jakarta.servlet.ServletRequest
 
- 
getProtocolDeprecated.- Specified by:
- getProtocolin interface- jakarta.servlet.ServletRequest
 
- 
getParameterDeprecated.- Specified by:
- getParameterin interface- jakarta.servlet.ServletRequest
 
- 
getParameterNamesDeprecated.- Specified by:
- getParameterNamesin interface- jakarta.servlet.ServletRequest
 
- 
getParameterValuesDeprecated.- Specified by:
- getParameterValuesin interface- jakarta.servlet.ServletRequest
 
- 
getSchemeDeprecated.- Specified by:
- getSchemein interface- jakarta.servlet.ServletRequest
 
- 
getServerNameDeprecated.- Specified by:
- getServerNamein interface- jakarta.servlet.ServletRequest
 
- 
getServerPortpublic int getServerPort()Deprecated.- Specified by:
- getServerPortin interface- jakarta.servlet.ServletRequest
 
- 
getRealPathDeprecated.- Specified by:
- getRealPathin interface- jakarta.servlet.ServletRequest
 
- 
getReaderDeprecated.- Specified by:
- getReaderin interface- jakarta.servlet.ServletRequest
- Throws:
- IOException
 
- 
getRemoteAddrDeprecated.- Specified by:
- getRemoteAddrin interface- jakarta.servlet.ServletRequest
 
- 
getRemoteHostDeprecated.- Specified by:
- getRemoteHostin interface- jakarta.servlet.ServletRequest
 
- 
setAttributeDeprecated.- Specified by:
- setAttributein interface- jakarta.servlet.ServletRequest
 
- 
removeAttributeDeprecated.- Specified by:
- removeAttributein interface- jakarta.servlet.ServletRequest
 
- 
getLocaleDeprecated.- Specified by:
- getLocalein interface- jakarta.servlet.ServletRequest
 
- 
getLocalesDeprecated.- Specified by:
- getLocalesin interface- jakarta.servlet.ServletRequest
 
- 
isSecurepublic boolean isSecure()Deprecated.- Specified by:
- isSecurein interface- jakarta.servlet.ServletRequest
 
- 
getRequestDispatcherDeprecated.- Specified by:
- getRequestDispatcherin interface- jakarta.servlet.ServletRequest
 
- 
getRequestpublic jakarta.servlet.ServletRequest getRequest()Deprecated.
- 
getParameterMapDeprecated.- Specified by:
- getParameterMapin interface- jakarta.servlet.ServletRequest
 
- 
setCharacterEncodingDeprecated.- Specified by:
- setCharacterEncodingin interface- jakarta.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); } }