Class MockHttpServletRequest

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

    public class MockHttpServletRequest
    extends java.lang.Object
    implements javax.servlet.http.HttpServletRequest
    Mock servlet request. Implements all of the methods from the standard HttpServletRequest class plus helper methods to aid setting up a request.
    Author:
    Chris Turner
    • Field Summary

      • Fields inherited from interface javax.servlet.http.HttpServletRequest

        BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
    • Constructor Summary

      Constructors 
      Constructor Description
      MockHttpServletRequest​(Application application, javax.servlet.http.HttpSession session, javax.servlet.ServletContext context)  
      MockHttpServletRequest​(Application application, javax.servlet.http.HttpSession session, javax.servlet.ServletContext context, java.util.Locale locale)
      Create the request using the supplied session object.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void addCookie​(javax.servlet.http.Cookie cookie)
      Add a new cookie.
      void addCookies​(java.lang.Iterable<javax.servlet.http.Cookie> cookies)  
      void addDateHeader​(java.lang.String name, long date)  
      void addFile​(java.lang.String fieldName, org.apache.wicket.util.file.File file, java.lang.String contentType)
      Add an uploaded file to the request.
      void addHeader​(java.lang.String name, java.lang.String value)
      Add a header to the request.
      void addParameter​(java.lang.String name, java.lang.String value)  
      boolean authenticate​(javax.servlet.http.HttpServletResponse response)  
      java.lang.String changeSessionId()  
      javax.servlet.AsyncContext getAsyncContext()  
      java.lang.Object getAttribute​(java.lang.String name)
      Get an attribute.
      java.util.Enumeration<java.lang.String> getAttributeNames()
      Get the names of all of the values.
      java.lang.String getAuthType()
      Get the auth type.
      java.lang.String getCharacterEncoding()
      Get the current character encoding.
      java.nio.charset.Charset getCharset()
      Get the current character set.
      int getContentLength()
      Return the length of the content.
      long getContentLengthLong()  
      java.lang.String getContentType()
      If useMultiPartContentType set as true return the correct content-type.
      java.lang.String getContextPath()
      Get the context path.
      javax.servlet.http.Cookie getCookie​(java.lang.String name)  
      javax.servlet.http.Cookie[] getCookies()
      Get all of the cookies for this request.
      long getDateHeader​(java.lang.String name)
      Get the given header as a date.
      javax.servlet.DispatcherType getDispatcherType()  
      java.lang.String getFilterPrefix()  
      java.lang.String getHeader​(java.lang.String name)
      Get the given header value.
      java.util.Enumeration<java.lang.String> getHeaderNames()
      Get the names of all of the headers.
      java.util.Enumeration<java.lang.String> getHeaders​(java.lang.String name)
      Get enumeration of all header values with the given name.
      javax.servlet.ServletInputStream getInputStream()
      Returns an input stream if there has been added some uploaded files.
      int getIntHeader​(java.lang.String name)
      Get the given header as an int.
      java.lang.String getLocalAddr()  
      java.util.Locale getLocale()
      Get the locale of the request.
      java.util.Enumeration<java.util.Locale> getLocales()
      Return all the accepted locales.
      java.lang.String getLocalName()  
      int getLocalPort()  
      java.lang.String getMethod()
      Get the method.
      java.lang.String getParameter​(java.lang.String name)
      Get the request parameter with the given name.
      java.util.Map<java.lang.String,​java.lang.String[]> getParameterMap()
      Get the map of all of the parameters.
      java.util.Enumeration<java.lang.String> getParameterNames()
      Get the names of all of the parameters.
      java.lang.String[] getParameterValues​(java.lang.String name)
      Get the values for the given parameter.
      javax.servlet.http.Part getPart​(java.lang.String name)  
      java.util.Collection<javax.servlet.http.Part> getParts()  
      java.lang.String getPathInfo()
      Get the path info.
      java.lang.String getPathTranslated()
      Always returns null.
      MockRequestParameters getPostParameters()  
      java.lang.String getProtocol()
      Get the protocol.
      java.lang.String getQueryString()
      Get the query string part of the request.
      java.io.BufferedReader getReader()
      This feature is not implemented at this time as we are not supporting binary servlet input.
      java.lang.String getRealPath​(java.lang.String name)
      Deprecated.
      Use ServletContext.getRealPath(String) instead.
      java.lang.String getRemoteAddr()  
      java.lang.String getRemoteHost()
      Get the remote host.
      int getRemotePort()  
      java.lang.String getRemoteUser()
      Get the name of the remote user from the REMOTE_USER header.
      javax.servlet.RequestDispatcher getRequestDispatcher​(java.lang.String name)
      Return a dummy dispatcher that just records that dispatch has occurred without actually doing anything.
      java.lang.String getRequestedSessionId()
      Get the requested session id.
      java.lang.String getRequestURI()
      Returns context path and servlet path concatenated, typically /applicationClassName/applicationClassName
      java.lang.StringBuffer getRequestURL()
      Try to build a rough URL.
      java.lang.String getScheme()
      Get the scheme.
      java.lang.String getServerName()
      Get the server name.
      int getServerPort()  
      javax.servlet.ServletContext getServletContext()  
      java.lang.String getServletPath()
      The servlet path may either be the application name or /.
      javax.servlet.http.HttpSession getSession()
      Get the sessions.
      javax.servlet.http.HttpSession getSession​(boolean createNew)
      Get the session.
      org.apache.wicket.request.Url getUrl()  
      java.security.Principal getUserPrincipal()
      Get the user principal.
      boolean hasUploadedFiles()  
      void initialize​(java.util.Locale locale)
      Reset the request back to a default state.
      boolean isAsyncStarted()  
      boolean isAsyncSupported()  
      boolean isRequestedSessionIdFromCookie()
      Check whether session id is from a cookie.
      boolean isRequestedSessionIdFromUrl()
      Check whether session id is from a url rewrite.
      boolean isRequestedSessionIdFromURL()
      Check whether session id is from a url rewrite.
      boolean isRequestedSessionIdValid()
      Check whether the session id is valid.
      boolean isSecure()  
      boolean isUserInRole​(java.lang.String name)
      NOT IMPLEMENTED.
      void login​(java.lang.String username, java.lang.String password)  
      void logout()  
      void removeAttribute​(java.lang.String name)
      Remove the given attribute.
      void setAttribute​(java.lang.String name, java.lang.Object o)
      Set the given attribute.
      void setAuthType​(java.lang.String authType)
      Set the auth type.
      void setCharacterEncoding​(java.lang.String encoding)
      Set the character encoding.
      void setCookies​(javax.servlet.http.Cookie[] theCookies)
      Set the cookies.
      void setHeader​(java.lang.String name, java.lang.String value)
      Sets a header to the request.
      void setLocale​(java.util.Locale locale)  
      void setMethod​(java.lang.String method)
      Set the method.
      void setParameter​(java.lang.String name, java.lang.String value)
      Set a parameter.
      void setParameters​(java.util.Map<java.lang.String,​java.lang.String[]> parameters)
      Sets a map of parameters.
      MockHttpServletRequest setPart​(java.lang.String name, javax.servlet.http.Part part)  
      void setPath​(java.lang.String path)
      Set the path that this request is supposed to be serving.
      void setRemoteAddr​(java.lang.String addr)  
      void setScheme​(java.lang.String scheme)
      Sets the scheme of this request
      void setSecure​(boolean secure)  
      void setServerName​(java.lang.String serverName)
      Set the server name.
      void setServerPort​(int port)
      Sets the server port for this request
      void setUrl​(org.apache.wicket.request.Url url)  
      void setURL​(java.lang.String url)
      Set the complete url for this request.
      void setUseMultiPartContentType​(boolean useMultiPartContentType)
      true will force Request generate multiPart ContentType and ContentLength
      javax.servlet.AsyncContext startAsync()  
      javax.servlet.AsyncContext startAsync​(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse)  
      <T extends javax.servlet.http.HttpUpgradeHandler>
      T
      upgrade​(java.lang.Class<T> aClass)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MockHttpServletRequest

        public MockHttpServletRequest​(Application application,
                                      javax.servlet.http.HttpSession session,
                                      javax.servlet.ServletContext context,
                                      java.util.Locale locale)
        Create the request using the supplied session object. Note that in order for temporary sessions to work, the supplied session must be an instance of MockHttpSession
        Parameters:
        application - The application that this request is for
        session - The session object
        context - The current servlet context
        locale - The current locale
      • MockHttpServletRequest

        public MockHttpServletRequest​(Application application,
                                      javax.servlet.http.HttpSession session,
                                      javax.servlet.ServletContext context)
    • Method Detail

      • addCookie

        public void addCookie​(javax.servlet.http.Cookie cookie)
        Add a new cookie.
        Parameters:
        cookie - The cookie
      • addCookies

        public void addCookies​(java.lang.Iterable<javax.servlet.http.Cookie> cookies)
        Parameters:
        cookies -
      • addFile

        public void addFile​(java.lang.String fieldName,
                            org.apache.wicket.util.file.File file,
                            java.lang.String contentType)
        Add an uploaded file to the request. Use this to simulate a file that has been uploaded to a field.
        Parameters:
        fieldName - The fieldname of the upload field.
        file - The file to upload.
        contentType - The content type of the file. Must be a correct mimetype.
      • addHeader

        public void addHeader​(java.lang.String name,
                              java.lang.String value)
        Add a header to the request.
        Parameters:
        name - The name of the header to add
        value - The value
      • setHeader

        public void setHeader​(java.lang.String name,
                              java.lang.String value)
        Sets a header to the request. Overrides any previous value of this header.
        Parameters:
        name - The name of the header to add
        value - The value
        See Also:
        addHeader(String, String)
      • addDateHeader

        public void addDateHeader​(java.lang.String name,
                                  long date)
        Parameters:
        name -
        date -
      • getAttribute

        public java.lang.Object getAttribute​(java.lang.String name)
        Get an attribute.
        Specified by:
        getAttribute in interface javax.servlet.ServletRequest
        Parameters:
        name - The attribute name
        Returns:
        The value, or null
      • getAttributeNames

        public java.util.Enumeration<java.lang.String> getAttributeNames()
        Get the names of all of the values.
        Specified by:
        getAttributeNames in interface javax.servlet.ServletRequest
        Returns:
        The names
      • getAuthType

        public java.lang.String getAuthType()
        Get the auth type.
        Specified by:
        getAuthType in interface javax.servlet.http.HttpServletRequest
        Returns:
        The auth type
      • getCharacterEncoding

        public java.lang.String getCharacterEncoding()
        Get the current character encoding.
        Specified by:
        getCharacterEncoding in interface javax.servlet.ServletRequest
        Returns:
        The character encoding
      • getCharset

        public java.nio.charset.Charset getCharset()
        Get the current character set.
        Returns:
        The character set
      • setUseMultiPartContentType

        public void setUseMultiPartContentType​(boolean useMultiPartContentType)
        true will force Request generate multiPart ContentType and ContentLength
        Parameters:
        useMultiPartContentType -
      • getContentLength

        public int getContentLength()
        Return the length of the content. This is always -1 except if useMultiPartContentType set as true. Then the length will be the length of the generated request.
        Specified by:
        getContentLength in interface javax.servlet.ServletRequest
        Returns:
        -1 if useMultiPartContentType is false. Else the length of the generated request.
      • getContentLengthLong

        public long getContentLengthLong()
        Specified by:
        getContentLengthLong in interface javax.servlet.ServletRequest
      • getContentType

        public java.lang.String getContentType()
        If useMultiPartContentType set as true return the correct content-type.
        Specified by:
        getContentType in interface javax.servlet.ServletRequest
        Returns:
        The correct multipart content-type if useMultiPartContentType is true. Else null.
      • getContextPath

        public java.lang.String getContextPath()
        Get the context path. For this mock implementation the name of the application is always returned.
        Specified by:
        getContextPath in interface javax.servlet.http.HttpServletRequest
        Returns:
        The context path
      • getCookie

        public javax.servlet.http.Cookie getCookie​(java.lang.String name)
        Parameters:
        name -
        Returns:
        Cookie
      • getCookies

        public javax.servlet.http.Cookie[] getCookies()
        Get all of the cookies for this request.
        Specified by:
        getCookies in interface javax.servlet.http.HttpServletRequest
        Returns:
        The cookies
      • getDateHeader

        public long getDateHeader​(java.lang.String name)
                           throws java.lang.IllegalArgumentException
        Get the given header as a date.
        Specified by:
        getDateHeader in interface javax.servlet.http.HttpServletRequest
        Parameters:
        name - The header name
        Returns:
        The date, or -1 if header not found
        Throws:
        java.lang.IllegalArgumentException - If the header cannot be converted
      • getHeader

        public java.lang.String getHeader​(java.lang.String name)
        Get the given header value.
        Specified by:
        getHeader in interface javax.servlet.http.HttpServletRequest
        Parameters:
        name - The header name
        Returns:
        The header value or null
      • getHeaderNames

        public java.util.Enumeration<java.lang.String> getHeaderNames()
        Get the names of all of the headers.
        Specified by:
        getHeaderNames in interface javax.servlet.http.HttpServletRequest
        Returns:
        The header names
      • getHeaders

        public java.util.Enumeration<java.lang.String> getHeaders​(java.lang.String name)
        Get enumeration of all header values with the given name.
        Specified by:
        getHeaders in interface javax.servlet.http.HttpServletRequest
        Parameters:
        name - The name
        Returns:
        The header values
      • getInputStream

        public javax.servlet.ServletInputStream getInputStream()
                                                        throws java.io.IOException
        Returns an input stream if there has been added some uploaded files. Use addFile(String, File, String) to add some uploaded files.
        Specified by:
        getInputStream in interface javax.servlet.ServletRequest
        Returns:
        The input stream
        Throws:
        java.io.IOException - If an I/O related problem occurs
      • getIntHeader

        public int getIntHeader​(java.lang.String name)
        Get the given header as an int.
        Specified by:
        getIntHeader in interface javax.servlet.http.HttpServletRequest
        Parameters:
        name - The header name
        Returns:
        The header value or -1 if header not found
        Throws:
        java.lang.NumberFormatException - If the header is not formatted correctly
      • getLocale

        public java.util.Locale getLocale()
        Get the locale of the request. Attempts to decode the Accept-Language header and if not found returns the default locale of the JVM.
        Specified by:
        getLocale in interface javax.servlet.ServletRequest
        Returns:
        The locale
      • setLocale

        public void setLocale​(java.util.Locale locale)
      • getLocales

        public java.util.Enumeration<java.util.Locale> getLocales()
        Return all the accepted locales. This implementation always returns just one.
        Specified by:
        getLocales in interface javax.servlet.ServletRequest
        Returns:
        The locales
      • getMethod

        public java.lang.String getMethod()
        Get the method.
        Specified by:
        getMethod in interface javax.servlet.http.HttpServletRequest
        Returns:
        The method
      • getParameter

        public java.lang.String getParameter​(java.lang.String name)
        Get the request parameter with the given name.
        Specified by:
        getParameter in interface javax.servlet.ServletRequest
        Parameters:
        name - The parameter name
        Returns:
        The parameter value, or null
      • getParameterMap

        public java.util.Map<java.lang.String,​java.lang.String[]> getParameterMap()
        Get the map of all of the parameters.
        Specified by:
        getParameterMap in interface javax.servlet.ServletRequest
        Returns:
        The parameters
      • getParameterNames

        public java.util.Enumeration<java.lang.String> getParameterNames()
        Get the names of all of the parameters.
        Specified by:
        getParameterNames in interface javax.servlet.ServletRequest
        Returns:
        The parameter names
      • getParameterValues

        public java.lang.String[] getParameterValues​(java.lang.String name)
        Get the values for the given parameter.
        Specified by:
        getParameterValues in interface javax.servlet.ServletRequest
        Parameters:
        name - The name of the parameter
        Returns:
        The return values
      • getPathInfo

        public java.lang.String getPathInfo()
        Get the path info.
        Specified by:
        getPathInfo in interface javax.servlet.http.HttpServletRequest
        Returns:
        The path info
      • getPathTranslated

        public java.lang.String getPathTranslated()
        Always returns null.
        Specified by:
        getPathTranslated in interface javax.servlet.http.HttpServletRequest
        Returns:
        null
      • getProtocol

        public java.lang.String getProtocol()
        Get the protocol.
        Specified by:
        getProtocol in interface javax.servlet.ServletRequest
        Returns:
        Always HTTP/1.1
      • getQueryString

        public java.lang.String getQueryString()
        Get the query string part of the request.
        Specified by:
        getQueryString in interface javax.servlet.http.HttpServletRequest
        Returns:
        The query string
      • getReader

        public java.io.BufferedReader getReader()
                                         throws java.io.IOException
        This feature is not implemented at this time as we are not supporting binary servlet input. This functionality may be added in the future.
        Specified by:
        getReader in interface javax.servlet.ServletRequest
        Returns:
        The reader
        Throws:
        java.io.IOException - If an I/O related problem occurs
      • getRealPath

        @Deprecated
        public java.lang.String getRealPath​(java.lang.String name)
        Deprecated.
        Use ServletContext.getRealPath(String) instead.
        Deprecated method - should not be used.
        Specified by:
        getRealPath in interface javax.servlet.ServletRequest
        Parameters:
        name - The name
        Returns:
        The path
      • getRemoteAddr

        public java.lang.String getRemoteAddr()
        Specified by:
        getRemoteAddr in interface javax.servlet.ServletRequest
        Returns:
        the remote address of the client
      • setRemoteAddr

        public void setRemoteAddr​(java.lang.String addr)
        Parameters:
        addr - Format: "aaa.bbb.ccc.ddd"
      • getRemoteHost

        public java.lang.String getRemoteHost()
        Get the remote host.
        Specified by:
        getRemoteHost in interface javax.servlet.ServletRequest
        Returns:
        Return 'localhost' by default
      • getRemoteUser

        public java.lang.String getRemoteUser()
        Get the name of the remote user from the REMOTE_USER header.
        Specified by:
        getRemoteUser in interface javax.servlet.http.HttpServletRequest
        Returns:
        The name of the remote user
      • getRequestDispatcher

        public javax.servlet.RequestDispatcher getRequestDispatcher​(java.lang.String name)
        Return a dummy dispatcher that just records that dispatch has occurred without actually doing anything.
        Specified by:
        getRequestDispatcher in interface javax.servlet.ServletRequest
        Parameters:
        name - The name to dispatch to
        Returns:
        The dispatcher
      • getRequestedSessionId

        public java.lang.String getRequestedSessionId()
        Get the requested session id. Always returns the id of the current session.
        Specified by:
        getRequestedSessionId in interface javax.servlet.http.HttpServletRequest
        Returns:
        The session id
      • getRequestURI

        public java.lang.String getRequestURI()
        Returns context path and servlet path concatenated, typically /applicationClassName/applicationClassName
        Specified by:
        getRequestURI in interface javax.servlet.http.HttpServletRequest
        Returns:
        The path value
        See Also:
        HttpServletRequest.getRequestURI()
      • getRequestURL

        public java.lang.StringBuffer getRequestURL()
        Try to build a rough URL.
        Specified by:
        getRequestURL in interface javax.servlet.http.HttpServletRequest
        Returns:
        The url
        See Also:
        HttpServletRequest.getRequestURL()
      • getScheme

        public java.lang.String getScheme()
        Get the scheme.
        Specified by:
        getScheme in interface javax.servlet.ServletRequest
        Returns:
        the scheme of this request
      • setScheme

        public void setScheme​(java.lang.String scheme)
        Sets the scheme of this request

        set the secure flag accordingly (true for 'https', false otherwise)

        Parameters:
        scheme - protocol scheme (e.g. https, http, ftp)
        See Also:
        isSecure()
      • getServerName

        public java.lang.String getServerName()
        Get the server name.
        Specified by:
        getServerName in interface javax.servlet.ServletRequest
        Returns:
        by default returns 'localhost'
      • setServerName

        public void setServerName​(java.lang.String serverName)
        Set the server name.
        Parameters:
        serverName - content of 'Host' header
      • getServerPort

        public int getServerPort()
        Specified by:
        getServerPort in interface javax.servlet.ServletRequest
        Returns:
        the server port of this request
      • setServerPort

        public void setServerPort​(int port)
        Sets the server port for this request
        Parameters:
        port -
      • getServletPath

        public java.lang.String getServletPath()
        The servlet path may either be the application name or /. For test purposes we always return the servlet name.
        Specified by:
        getServletPath in interface javax.servlet.http.HttpServletRequest
        Returns:
        The servlet path
      • getSession

        public javax.servlet.http.HttpSession getSession()
        Get the sessions.
        Specified by:
        getSession in interface javax.servlet.http.HttpServletRequest
        Returns:
        The session
      • changeSessionId

        public java.lang.String changeSessionId()
        Specified by:
        changeSessionId in interface javax.servlet.http.HttpServletRequest
      • getSession

        public javax.servlet.http.HttpSession getSession​(boolean createNew)
        Get the session.
        Specified by:
        getSession in interface javax.servlet.http.HttpServletRequest
        Parameters:
        createNew - Ignored, there is always a session
        Returns:
        The session
      • getUserPrincipal

        public java.security.Principal getUserPrincipal()
        Get the user principal.
        Specified by:
        getUserPrincipal in interface javax.servlet.http.HttpServletRequest
        Returns:
        A user principal
      • hasUploadedFiles

        public boolean hasUploadedFiles()
        Returns:
        True if there has been added files to this request using addFile(String, File, String)
      • initialize

        public void initialize​(java.util.Locale locale)
        Reset the request back to a default state.
        Parameters:
        locale -
      • isRequestedSessionIdFromCookie

        public boolean isRequestedSessionIdFromCookie()
        Check whether session id is from a cookie. Always returns true.
        Specified by:
        isRequestedSessionIdFromCookie in interface javax.servlet.http.HttpServletRequest
        Returns:
        Always true
      • isRequestedSessionIdFromUrl

        public boolean isRequestedSessionIdFromUrl()
        Check whether session id is from a url rewrite. Always returns false.
        Specified by:
        isRequestedSessionIdFromUrl in interface javax.servlet.http.HttpServletRequest
        Returns:
        Always false
      • 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
        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
        Throws:
        javax.servlet.ServletException
      • logout

        public void logout()
                    throws javax.servlet.ServletException
        Specified by:
        logout in interface javax.servlet.http.HttpServletRequest
        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
        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
        Throws:
        java.io.IOException
        javax.servlet.ServletException
      • upgrade

        public <T extends javax.servlet.http.HttpUpgradeHandler> T upgrade​(java.lang.Class<T> aClass)
                                                                    throws java.io.IOException,
                                                                           javax.servlet.ServletException
        Specified by:
        upgrade in interface javax.servlet.http.HttpServletRequest
        Throws:
        java.io.IOException
        javax.servlet.ServletException
      • isRequestedSessionIdFromURL

        public boolean isRequestedSessionIdFromURL()
        Check whether session id is from a url rewrite. Always returns false.
        Specified by:
        isRequestedSessionIdFromURL in interface javax.servlet.http.HttpServletRequest
        Returns:
        Always false
      • isRequestedSessionIdValid

        public boolean isRequestedSessionIdValid()
        Check whether the session id is valid.
        Specified by:
        isRequestedSessionIdValid in interface javax.servlet.http.HttpServletRequest
        Returns:
        Always true
      • isSecure

        public boolean isSecure()
        Specified by:
        isSecure in interface javax.servlet.ServletRequest
        Returns:
        true if this request's scheme is 'https', false - otherwise
      • setSecure

        public void setSecure​(boolean secure)
        Parameters:
        secure -
      • isUserInRole

        public boolean isUserInRole​(java.lang.String name)
        NOT IMPLEMENTED.
        Specified by:
        isUserInRole in interface javax.servlet.http.HttpServletRequest
        Parameters:
        name - The role name
        Returns:
        Always false
      • removeAttribute

        public void removeAttribute​(java.lang.String name)
        Remove the given attribute.
        Specified by:
        removeAttribute in interface javax.servlet.ServletRequest
        Parameters:
        name - The name of the attribute
      • setAttribute

        public void setAttribute​(java.lang.String name,
                                 java.lang.Object o)
        Set the given attribute.
        Specified by:
        setAttribute in interface javax.servlet.ServletRequest
        Parameters:
        name - The attribute name
        o - The value to set
      • setAuthType

        public void setAuthType​(java.lang.String authType)
        Set the auth type.
        Parameters:
        authType - The auth type
      • setCharacterEncoding

        public void setCharacterEncoding​(java.lang.String encoding)
                                  throws java.io.UnsupportedEncodingException
        Set the character encoding.
        Specified by:
        setCharacterEncoding in interface javax.servlet.ServletRequest
        Parameters:
        encoding - The character encoding
        Throws:
        java.io.UnsupportedEncodingException - If encoding not supported
      • setCookies

        public void setCookies​(javax.servlet.http.Cookie[] theCookies)
        Set the cookies.
        Parameters:
        theCookies - The cookies
      • setMethod

        public void setMethod​(java.lang.String method)
        Set the method.
        Parameters:
        method - The method
      • setParameter

        public void setParameter​(java.lang.String name,
                                 java.lang.String value)
        Set a parameter.
        Parameters:
        name - The name
        value - The value
      • addParameter

        public void addParameter​(java.lang.String name,
                                 java.lang.String value)
        Parameters:
        name -
        value -
      • setParameters

        public void setParameters​(java.util.Map<java.lang.String,​java.lang.String[]> parameters)
        Sets a map of parameters.
        Parameters:
        parameters - the parameters to set
      • setPath

        public void setPath​(java.lang.String path)
        Set the path that this request is supposed to be serving. The path is relative to the web application root and should start with a / character
        Parameters:
        path -
      • setURL

        public void setURL​(java.lang.String url)
        Set the complete url for this request. The url will be analyzed.
        Parameters:
        url -
      • getLocalAddr

        public java.lang.String getLocalAddr()
        Specified by:
        getLocalAddr in interface javax.servlet.ServletRequest
        Returns:
        local address
      • getLocalName

        public java.lang.String getLocalName()
        Specified by:
        getLocalName in interface javax.servlet.ServletRequest
        Returns:
        local host name
      • getLocalPort

        public int getLocalPort()
        Specified by:
        getLocalPort in interface javax.servlet.ServletRequest
        Returns:
        local port
      • getRemotePort

        public int getRemotePort()
        Specified by:
        getRemotePort in interface javax.servlet.ServletRequest
        Returns:
        remote port
      • setUrl

        public void setUrl​(org.apache.wicket.request.Url url)
        Parameters:
        url -
      • getUrl

        public org.apache.wicket.request.Url getUrl()
        Returns:
        request url
      • getFilterPrefix

        public java.lang.String getFilterPrefix()
        Returns:
        filter prefix
      • getServletContext

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

        public javax.servlet.AsyncContext startAsync()
                                              throws java.lang.IllegalStateException
        Specified by:
        startAsync in interface javax.servlet.ServletRequest
        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
        Throws:
        java.lang.IllegalStateException
      • isAsyncStarted

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

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

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

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