Class FacadeHttpServletRequest

  • All Implemented Interfaces:
    javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest

    public class FacadeHttpServletRequest
    extends javax.servlet.http.HttpServletRequestWrapper
    A facade request object to avoid holding a recycled request instance.
    Since:
    8.5.0
    Author:
    wenninghsu
    • Constructor Detail

      • FacadeHttpServletRequest

        public FacadeHttpServletRequest​(javax.servlet.http.HttpServletRequest request)
      • FacadeHttpServletRequest

        public FacadeHttpServletRequest​(javax.servlet.http.HttpServletRequest request,
                                        boolean keepAttributes)
        Parameters:
        request - the original request
        keepAttributes - whether to keep the attributes
        Since:
        9.6.0
    • Method Detail

      • getAuthType

        public java.lang.String getAuthType()
        Specified by:
        getAuthType in interface javax.servlet.http.HttpServletRequest
        Overrides:
        getAuthType in class javax.servlet.http.HttpServletRequestWrapper
      • getCookies

        public javax.servlet.http.Cookie[] getCookies()
        Specified by:
        getCookies in interface javax.servlet.http.HttpServletRequest
        Overrides:
        getCookies in class javax.servlet.http.HttpServletRequestWrapper
      • getDateHeader

        public long getDateHeader​(java.lang.String name)
        Specified by:
        getDateHeader in interface javax.servlet.http.HttpServletRequest
        Overrides:
        getDateHeader in class javax.servlet.http.HttpServletRequestWrapper
      • getHeader

        public java.lang.String getHeader​(java.lang.String name)
        Specified by:
        getHeader in interface javax.servlet.http.HttpServletRequest
        Overrides:
        getHeader in class javax.servlet.http.HttpServletRequestWrapper
      • getHeaders

        public java.util.Enumeration<java.lang.String> getHeaders​(java.lang.String name)
        Specified by:
        getHeaders in interface javax.servlet.http.HttpServletRequest
        Overrides:
        getHeaders in class javax.servlet.http.HttpServletRequestWrapper
      • getHeaderNames

        public java.util.Enumeration<java.lang.String> getHeaderNames()
        Specified by:
        getHeaderNames in interface javax.servlet.http.HttpServletRequest
        Overrides:
        getHeaderNames in class javax.servlet.http.HttpServletRequestWrapper
      • getIntHeader

        public int getIntHeader​(java.lang.String name)
                         throws java.lang.NumberFormatException
        Specified by:
        getIntHeader in interface javax.servlet.http.HttpServletRequest
        Overrides:
        getIntHeader in class javax.servlet.http.HttpServletRequestWrapper
        Throws:
        java.lang.NumberFormatException
      • getMethod

        public java.lang.String getMethod()
        Specified by:
        getMethod in interface javax.servlet.http.HttpServletRequest
        Overrides:
        getMethod in class javax.servlet.http.HttpServletRequestWrapper
      • getPathInfo

        public java.lang.String getPathInfo()
        Specified by:
        getPathInfo in interface javax.servlet.http.HttpServletRequest
        Overrides:
        getPathInfo in class javax.servlet.http.HttpServletRequestWrapper
      • getPathTranslated

        public java.lang.String getPathTranslated()
        Specified by:
        getPathTranslated in interface javax.servlet.http.HttpServletRequest
        Overrides:
        getPathTranslated in class javax.servlet.http.HttpServletRequestWrapper
      • getContextPath

        public java.lang.String getContextPath()
        Specified by:
        getContextPath in interface javax.servlet.http.HttpServletRequest
        Overrides:
        getContextPath in class javax.servlet.http.HttpServletRequestWrapper
      • getQueryString

        public java.lang.String getQueryString()
        Specified by:
        getQueryString in interface javax.servlet.http.HttpServletRequest
        Overrides:
        getQueryString in class javax.servlet.http.HttpServletRequestWrapper
      • getRemoteUser

        public java.lang.String getRemoteUser()
        Specified by:
        getRemoteUser in interface javax.servlet.http.HttpServletRequest
        Overrides:
        getRemoteUser in class javax.servlet.http.HttpServletRequestWrapper
      • isUserInRole

        public boolean isUserInRole​(java.lang.String role)
        Specified by:
        isUserInRole in interface javax.servlet.http.HttpServletRequest
        Overrides:
        isUserInRole in class javax.servlet.http.HttpServletRequestWrapper
      • getUserPrincipal

        public java.security.Principal getUserPrincipal()
        Specified by:
        getUserPrincipal in interface javax.servlet.http.HttpServletRequest
        Overrides:
        getUserPrincipal in class javax.servlet.http.HttpServletRequestWrapper
      • getRequestedSessionId

        public java.lang.String getRequestedSessionId()
        Specified by:
        getRequestedSessionId in interface javax.servlet.http.HttpServletRequest
        Overrides:
        getRequestedSessionId in class javax.servlet.http.HttpServletRequestWrapper
      • getRequestURI

        public java.lang.String getRequestURI()
        Specified by:
        getRequestURI in interface javax.servlet.http.HttpServletRequest
        Overrides:
        getRequestURI in class javax.servlet.http.HttpServletRequestWrapper
      • getRequestURL

        public java.lang.StringBuffer getRequestURL()
        Specified by:
        getRequestURL in interface javax.servlet.http.HttpServletRequest
        Overrides:
        getRequestURL in class javax.servlet.http.HttpServletRequestWrapper
      • getServletPath

        public java.lang.String getServletPath()
        Specified by:
        getServletPath in interface javax.servlet.http.HttpServletRequest
        Overrides:
        getServletPath in class javax.servlet.http.HttpServletRequestWrapper
      • getSession

        public javax.servlet.http.HttpSession getSession​(boolean create)
        Specified by:
        getSession in interface javax.servlet.http.HttpServletRequest
        Overrides:
        getSession in class javax.servlet.http.HttpServletRequestWrapper
      • getSession

        public javax.servlet.http.HttpSession getSession()
        Specified by:
        getSession in interface javax.servlet.http.HttpServletRequest
        Overrides:
        getSession in class javax.servlet.http.HttpServletRequestWrapper
      • isRequestedSessionIdValid

        public boolean isRequestedSessionIdValid()
        Specified by:
        isRequestedSessionIdValid in interface javax.servlet.http.HttpServletRequest
        Overrides:
        isRequestedSessionIdValid in class javax.servlet.http.HttpServletRequestWrapper
      • isRequestedSessionIdFromCookie

        public boolean isRequestedSessionIdFromCookie()
        Specified by:
        isRequestedSessionIdFromCookie in interface javax.servlet.http.HttpServletRequest
        Overrides:
        isRequestedSessionIdFromCookie in class javax.servlet.http.HttpServletRequestWrapper
      • isRequestedSessionIdFromURL

        public boolean isRequestedSessionIdFromURL()
        Specified by:
        isRequestedSessionIdFromURL in interface javax.servlet.http.HttpServletRequest
        Overrides:
        isRequestedSessionIdFromURL in class javax.servlet.http.HttpServletRequestWrapper
      • isRequestedSessionIdFromUrl

        public boolean isRequestedSessionIdFromUrl()
        Specified by:
        isRequestedSessionIdFromUrl in interface javax.servlet.http.HttpServletRequest
        Overrides:
        isRequestedSessionIdFromUrl in class javax.servlet.http.HttpServletRequestWrapper
      • authenticate

        public boolean authenticate​(javax.servlet.http.HttpServletResponse response)
                             throws java.io.IOException,
                                    javax.servlet.ServletException
        Specified by:
        authenticate in interface javax.servlet.http.HttpServletRequest
        Overrides:
        authenticate in class javax.servlet.http.HttpServletRequestWrapper
        Throws:
        java.io.IOException
        javax.servlet.ServletException
      • login

        public void login​(java.lang.String username,
                          java.lang.String password)
                   throws javax.servlet.ServletException
        Specified by:
        login in interface javax.servlet.http.HttpServletRequest
        Overrides:
        login in class javax.servlet.http.HttpServletRequestWrapper
        Throws:
        javax.servlet.ServletException
      • logout

        public void logout()
                    throws javax.servlet.ServletException
        Specified by:
        logout in interface javax.servlet.http.HttpServletRequest
        Overrides:
        logout in class javax.servlet.http.HttpServletRequestWrapper
        Throws:
        javax.servlet.ServletException
      • getParts

        public java.util.Collection<javax.servlet.http.Part> getParts()
                                                               throws java.io.IOException,
                                                                      javax.servlet.ServletException
        Specified by:
        getParts in interface javax.servlet.http.HttpServletRequest
        Overrides:
        getParts in class javax.servlet.http.HttpServletRequestWrapper
        Throws:
        java.io.IOException
        javax.servlet.ServletException
      • getPart

        public javax.servlet.http.Part getPart​(java.lang.String name)
                                        throws java.io.IOException,
                                               javax.servlet.ServletException
        Specified by:
        getPart in interface javax.servlet.http.HttpServletRequest
        Overrides:
        getPart in class javax.servlet.http.HttpServletRequestWrapper
        Throws:
        java.io.IOException
        javax.servlet.ServletException
      • getAttribute

        public java.lang.Object getAttribute​(java.lang.String name)
        Specified by:
        getAttribute in interface javax.servlet.ServletRequest
        Overrides:
        getAttribute in class javax.servlet.ServletRequestWrapper
      • getAttributeNames

        public java.util.Enumeration<java.lang.String> getAttributeNames()
        Specified by:
        getAttributeNames in interface javax.servlet.ServletRequest
        Overrides:
        getAttributeNames in class javax.servlet.ServletRequestWrapper
      • getCharacterEncoding

        public java.lang.String getCharacterEncoding()
        Specified by:
        getCharacterEncoding in interface javax.servlet.ServletRequest
        Overrides:
        getCharacterEncoding in class javax.servlet.ServletRequestWrapper
      • setCharacterEncoding

        public void setCharacterEncoding​(java.lang.String env)
                                  throws java.io.UnsupportedEncodingException
        Specified by:
        setCharacterEncoding in interface javax.servlet.ServletRequest
        Overrides:
        setCharacterEncoding in class javax.servlet.ServletRequestWrapper
        Throws:
        java.io.UnsupportedEncodingException
      • getContentLength

        public int getContentLength()
        Specified by:
        getContentLength in interface javax.servlet.ServletRequest
        Overrides:
        getContentLength in class javax.servlet.ServletRequestWrapper
      • getContentType

        public java.lang.String getContentType()
        Specified by:
        getContentType in interface javax.servlet.ServletRequest
        Overrides:
        getContentType in class javax.servlet.ServletRequestWrapper
      • getInputStream

        public javax.servlet.ServletInputStream getInputStream()
                                                        throws java.io.IOException
        Specified by:
        getInputStream in interface javax.servlet.ServletRequest
        Overrides:
        getInputStream in class javax.servlet.ServletRequestWrapper
        Throws:
        java.io.IOException
      • getParameter

        public java.lang.String getParameter​(java.lang.String name)
        Specified by:
        getParameter in interface javax.servlet.ServletRequest
        Overrides:
        getParameter in class javax.servlet.ServletRequestWrapper
      • getParameterNames

        public java.util.Enumeration<java.lang.String> getParameterNames()
        Specified by:
        getParameterNames in interface javax.servlet.ServletRequest
        Overrides:
        getParameterNames in class javax.servlet.ServletRequestWrapper
      • getParameterValues

        public java.lang.String[] getParameterValues​(java.lang.String name)
        Specified by:
        getParameterValues in interface javax.servlet.ServletRequest
        Overrides:
        getParameterValues in class javax.servlet.ServletRequestWrapper
      • getParameterMap

        public java.util.Map<java.lang.String,​java.lang.String[]> getParameterMap()
        Specified by:
        getParameterMap in interface javax.servlet.ServletRequest
        Overrides:
        getParameterMap in class javax.servlet.ServletRequestWrapper
      • getProtocol

        public java.lang.String getProtocol()
        Specified by:
        getProtocol in interface javax.servlet.ServletRequest
        Overrides:
        getProtocol in class javax.servlet.ServletRequestWrapper
      • getScheme

        public java.lang.String getScheme()
        Specified by:
        getScheme in interface javax.servlet.ServletRequest
        Overrides:
        getScheme in class javax.servlet.ServletRequestWrapper
      • getServerName

        public java.lang.String getServerName()
        Specified by:
        getServerName in interface javax.servlet.ServletRequest
        Overrides:
        getServerName in class javax.servlet.ServletRequestWrapper
      • getServerPort

        public int getServerPort()
        Specified by:
        getServerPort in interface javax.servlet.ServletRequest
        Overrides:
        getServerPort in class javax.servlet.ServletRequestWrapper
      • getReader

        public java.io.BufferedReader getReader()
                                         throws java.io.IOException
        Specified by:
        getReader in interface javax.servlet.ServletRequest
        Overrides:
        getReader in class javax.servlet.ServletRequestWrapper
        Throws:
        java.io.IOException
      • getRemoteAddr

        public java.lang.String getRemoteAddr()
        Specified by:
        getRemoteAddr in interface javax.servlet.ServletRequest
        Overrides:
        getRemoteAddr in class javax.servlet.ServletRequestWrapper
      • getRemoteHost

        public java.lang.String getRemoteHost()
        Specified by:
        getRemoteHost in interface javax.servlet.ServletRequest
        Overrides:
        getRemoteHost in class javax.servlet.ServletRequestWrapper
      • setAttribute

        public void setAttribute​(java.lang.String name,
                                 java.lang.Object value)
        Specified by:
        setAttribute in interface javax.servlet.ServletRequest
        Overrides:
        setAttribute in class javax.servlet.ServletRequestWrapper
      • removeAttribute

        public void removeAttribute​(java.lang.String name)
        Specified by:
        removeAttribute in interface javax.servlet.ServletRequest
        Overrides:
        removeAttribute in class javax.servlet.ServletRequestWrapper
      • removeAllAttributes

        public void removeAllAttributes()
      • getLocale

        public java.util.Locale getLocale()
        Specified by:
        getLocale in interface javax.servlet.ServletRequest
        Overrides:
        getLocale in class javax.servlet.ServletRequestWrapper
      • getLocales

        public java.util.Enumeration<java.util.Locale> getLocales()
        Specified by:
        getLocales in interface javax.servlet.ServletRequest
        Overrides:
        getLocales in class javax.servlet.ServletRequestWrapper
      • isSecure

        public boolean isSecure()
        Specified by:
        isSecure in interface javax.servlet.ServletRequest
        Overrides:
        isSecure in class javax.servlet.ServletRequestWrapper
      • getRequestDispatcher

        public javax.servlet.RequestDispatcher getRequestDispatcher​(java.lang.String path)
        Specified by:
        getRequestDispatcher in interface javax.servlet.ServletRequest
        Overrides:
        getRequestDispatcher in class javax.servlet.ServletRequestWrapper
      • getRealPath

        public java.lang.String getRealPath​(java.lang.String path)
        Specified by:
        getRealPath in interface javax.servlet.ServletRequest
        Overrides:
        getRealPath in class javax.servlet.ServletRequestWrapper
      • getRemotePort

        public int getRemotePort()
        Specified by:
        getRemotePort in interface javax.servlet.ServletRequest
        Overrides:
        getRemotePort in class javax.servlet.ServletRequestWrapper
      • getLocalName

        public java.lang.String getLocalName()
        Specified by:
        getLocalName in interface javax.servlet.ServletRequest
        Overrides:
        getLocalName in class javax.servlet.ServletRequestWrapper
      • getLocalAddr

        public java.lang.String getLocalAddr()
        Specified by:
        getLocalAddr in interface javax.servlet.ServletRequest
        Overrides:
        getLocalAddr in class javax.servlet.ServletRequestWrapper
      • getLocalPort

        public int getLocalPort()
        Specified by:
        getLocalPort in interface javax.servlet.ServletRequest
        Overrides:
        getLocalPort in class javax.servlet.ServletRequestWrapper
      • getServletContext

        public javax.servlet.ServletContext getServletContext()
        Specified by:
        getServletContext in interface javax.servlet.ServletRequest
        Overrides:
        getServletContext in class javax.servlet.ServletRequestWrapper
      • startAsync

        public javax.servlet.AsyncContext startAsync()
                                              throws java.lang.IllegalStateException
        Specified by:
        startAsync in interface javax.servlet.ServletRequest
        Overrides:
        startAsync in class javax.servlet.ServletRequestWrapper
        Throws:
        java.lang.IllegalStateException
      • startAsync

        public javax.servlet.AsyncContext startAsync​(javax.servlet.ServletRequest servletRequest,
                                                     javax.servlet.ServletResponse servletResponse)
                                              throws java.lang.IllegalStateException
        Specified by:
        startAsync in interface javax.servlet.ServletRequest
        Overrides:
        startAsync in class javax.servlet.ServletRequestWrapper
        Throws:
        java.lang.IllegalStateException
      • isAsyncStarted

        public boolean isAsyncStarted()
        Specified by:
        isAsyncStarted in interface javax.servlet.ServletRequest
        Overrides:
        isAsyncStarted in class javax.servlet.ServletRequestWrapper
      • isAsyncSupported

        public boolean isAsyncSupported()
        Specified by:
        isAsyncSupported in interface javax.servlet.ServletRequest
        Overrides:
        isAsyncSupported in class javax.servlet.ServletRequestWrapper
      • getAsyncContext

        public javax.servlet.AsyncContext getAsyncContext()
        Specified by:
        getAsyncContext in interface javax.servlet.ServletRequest
        Overrides:
        getAsyncContext in class javax.servlet.ServletRequestWrapper
      • getDispatcherType

        public javax.servlet.DispatcherType getDispatcherType()
        Specified by:
        getDispatcherType in interface javax.servlet.ServletRequest
        Overrides:
        getDispatcherType in class javax.servlet.ServletRequestWrapper