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 Summary
Fields inherited from interface jakarta.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH -
Constructor Summary
Constructors -
Method Summary
Modifier 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.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.servlet.http.HttpServletRequest
authenticate, getPart, getParts, login, logoutMethods inherited from interface jakarta.servlet.ServletRequest
getAsyncContext, getDispatcherType, getLocalAddr, getLocalName, getLocalPort, getRemotePort, getServletContext, isAsyncStarted, isAsyncSupported, startAsync, startAsync
-
Constructor Details
-
HttpServletRequestProxy
public HttpServletRequestProxy()Deprecated.
-
-
Method Details
-
getAuthType
Deprecated.- Specified by:
getAuthTypein interfacejakarta.servlet.http.HttpServletRequest
-
getCookies
public jakarta.servlet.http.Cookie[] getCookies()Deprecated.- Specified by:
getCookiesin interfacejakarta.servlet.http.HttpServletRequest
-
getIntHeader
Deprecated.- Specified by:
getIntHeaderin interfacejakarta.servlet.http.HttpServletRequest
-
getDateHeader
Deprecated.- Specified by:
getDateHeaderin interfacejakarta.servlet.http.HttpServletRequest
-
getHeader
Deprecated.- Specified by:
getHeaderin interfacejakarta.servlet.http.HttpServletRequest
-
getHeaderNames
Deprecated.- Specified by:
getHeaderNamesin interfacejakarta.servlet.http.HttpServletRequest
-
getQueryString
Deprecated.- Specified by:
getQueryStringin interfacejakarta.servlet.http.HttpServletRequest
-
getMethod
Deprecated.- Specified by:
getMethodin interfacejakarta.servlet.http.HttpServletRequest
-
getPathInfo
Deprecated.- Specified by:
getPathInfoin interfacejakarta.servlet.http.HttpServletRequest
-
getPathTranslated
Deprecated.- Specified by:
getPathTranslatedin interfacejakarta.servlet.http.HttpServletRequest
-
getServletPath
Deprecated.- Specified by:
getServletPathin interfacejakarta.servlet.http.HttpServletRequest
-
getRemoteUser
Deprecated.- Specified by:
getRemoteUserin interfacejakarta.servlet.http.HttpServletRequest
-
getRequestedSessionId
Deprecated.- Specified by:
getRequestedSessionIdin interfacejakarta.servlet.http.HttpServletRequest
-
getRequestURI
Deprecated.- Specified by:
getRequestURIin interfacejakarta.servlet.http.HttpServletRequest
-
isRequestedSessionIdFromCookie
public boolean isRequestedSessionIdFromCookie()Deprecated.- Specified by:
isRequestedSessionIdFromCookiein interfacejakarta.servlet.http.HttpServletRequest
-
getSession
public jakarta.servlet.http.HttpSession getSession(boolean create) Deprecated.- Specified by:
getSessionin interfacejakarta.servlet.http.HttpServletRequest
-
getSession
public jakarta.servlet.http.HttpSession getSession()Deprecated.- Specified by:
getSessionin interfacejakarta.servlet.http.HttpServletRequest
-
isRequestedSessionIdValid
public boolean isRequestedSessionIdValid()Deprecated.- Specified by:
isRequestedSessionIdValidin interfacejakarta.servlet.http.HttpServletRequest
-
isRequestedSessionIdFromURL
public boolean isRequestedSessionIdFromURL()Deprecated.- Specified by:
isRequestedSessionIdFromURLin interfacejakarta.servlet.http.HttpServletRequest
-
isRequestedSessionIdFromUrl
public boolean isRequestedSessionIdFromUrl()Deprecated.- Specified by:
isRequestedSessionIdFromUrlin interfacejakarta.servlet.http.HttpServletRequest
-
getHeaders
Deprecated.- Specified by:
getHeadersin interfacejakarta.servlet.http.HttpServletRequest
-
getContextPath
Deprecated.- Specified by:
getContextPathin interfacejakarta.servlet.http.HttpServletRequest
-
isUserInRole
Deprecated.- Specified by:
isUserInRolein interfacejakarta.servlet.http.HttpServletRequest
-
getUserPrincipal
Deprecated.- Specified by:
getUserPrincipalin interfacejakarta.servlet.http.HttpServletRequest
-
getRequestURL
Deprecated.- Specified by:
getRequestURLin interfacejakarta.servlet.http.HttpServletRequest
-
getAttribute
Deprecated.- Specified by:
getAttributein interfacejakarta.servlet.ServletRequest
-
getAttributeNames
Deprecated.- Specified by:
getAttributeNamesin interfacejakarta.servlet.ServletRequest
-
getInputStream
Deprecated.- Specified by:
getInputStreamin interfacejakarta.servlet.ServletRequest- Throws:
IOException
-
getCharacterEncoding
Deprecated.- Specified by:
getCharacterEncodingin interfacejakarta.servlet.ServletRequest
-
getContentLength
public int getContentLength()Deprecated.- Specified by:
getContentLengthin interfacejakarta.servlet.ServletRequest
-
getContentType
Deprecated.- Specified by:
getContentTypein interfacejakarta.servlet.ServletRequest
-
getProtocol
Deprecated.- Specified by:
getProtocolin interfacejakarta.servlet.ServletRequest
-
getParameter
Deprecated.- Specified by:
getParameterin interfacejakarta.servlet.ServletRequest
-
getParameterNames
Deprecated.- Specified by:
getParameterNamesin interfacejakarta.servlet.ServletRequest
-
getParameterValues
Deprecated.- Specified by:
getParameterValuesin interfacejakarta.servlet.ServletRequest
-
getScheme
Deprecated.- Specified by:
getSchemein interfacejakarta.servlet.ServletRequest
-
getServerName
Deprecated.- Specified by:
getServerNamein interfacejakarta.servlet.ServletRequest
-
getServerPort
public int getServerPort()Deprecated.- Specified by:
getServerPortin interfacejakarta.servlet.ServletRequest
-
getRealPath
Deprecated.- Specified by:
getRealPathin interfacejakarta.servlet.ServletRequest
-
getReader
Deprecated.- Specified by:
getReaderin interfacejakarta.servlet.ServletRequest- Throws:
IOException
-
getRemoteAddr
Deprecated.- Specified by:
getRemoteAddrin interfacejakarta.servlet.ServletRequest
-
getRemoteHost
Deprecated.- Specified by:
getRemoteHostin interfacejakarta.servlet.ServletRequest
-
setAttribute
Deprecated.- Specified by:
setAttributein interfacejakarta.servlet.ServletRequest
-
removeAttribute
Deprecated.- Specified by:
removeAttributein interfacejakarta.servlet.ServletRequest
-
getLocale
Deprecated.- Specified by:
getLocalein interfacejakarta.servlet.ServletRequest
-
getLocales
Deprecated.- Specified by:
getLocalesin interfacejakarta.servlet.ServletRequest
-
isSecure
public boolean isSecure()Deprecated.- Specified by:
isSecurein interfacejakarta.servlet.ServletRequest
-
getRequestDispatcher
Deprecated.- Specified by:
getRequestDispatcherin interfacejakarta.servlet.ServletRequest
-
getRequest
public jakarta.servlet.ServletRequest getRequest()Deprecated. -
getParameterMap
Deprecated.- Specified by:
getParameterMapin interfacejakarta.servlet.ServletRequest
-
setCharacterEncoding
Deprecated.- Specified by:
setCharacterEncodingin interfacejakarta.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); } }