content
The Content for this request.
HttpServletRequest
, ServletRequest
Mock HttpServletRequest object for low-level unit tests of Struts controller components. Coarser grained tests should be implemented in terms of the Cactus framework, instead of the mock object classes.
WARNING - Only the minimal set of methods needed to
create unit tests is provided, plus additional methods to configure this
object as necessary. Methods for unsupported operations will throw
UnsupportedOperationException
.
WARNING - Because unit tests operate in a single threaded environment, no synchronization is performed.
protected String
protected byte[]
protected String
protected String
protected Locale
protected String
protected String
protected Principal
protected String
protected String
protected HttpSession
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
MockHttpServletRequest(HttpSession session)
MockHttpServletRequest(String contextPath,
String servletPath,
String pathInfo,
String queryString)
MockHttpServletRequest(String contextPath,
String servletPath,
String pathInfo,
String queryString,
HttpSession session)
void
addParameter(String name,
String value)
boolean
authenticate(HttpServletResponse response)
getAttribute(String name)
int
long
Cookie[]
long
getDateHeader(String name)
getHeaders(String name)
int
getIntHeader(String name)
int
getParameter(String name)
String[]
getParameterValues(String name)
getParts()
getRealPath(String path)
int
getRequestDispatcher(String path)
int
getSession(boolean create)
boolean
boolean
boolean
boolean
boolean
boolean
boolean
isSecure()
boolean
isUserInRole(String role)
void
void
logout()
void
removeAttribute(String name)
void
setAttribute(String name,
Object o)
void
void
setContent(byte[] content)
void
setContentType(String contentType)
void
setHttpSession(HttpSession session)
void
void
void
setPathElements(String contextPath,
String servletPath,
String pathInfo,
String queryString)
void
setUserPrincipal(Principal principal)
startAsync(ServletRequest servletRequest,
ServletResponse servletResponse)
<T extends HttpUpgradeHandler>
T
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getHttpServletMapping, getTrailerFields, isTrailerFieldsReady, newPushBuilder
The set of request attributes.
The context path for this request.
The preferred locale for this request.
The set of arrays of parameter values, keyed by parameter name.
The extra path information for this request. v *
The authenticated user for this request.
The query string for this request.
The servlet path for this request.
The HttpSession with which we are associated.
The HTTP request method.
The Content Type for this request.
The Character Encoding for this request.
The Content for this request.
getAuthType
in interface HttpServletRequest
getCookies
in interface HttpServletRequest
getDateHeader
in interface HttpServletRequest
getHeader
in interface HttpServletRequest
getHeaders
in interface HttpServletRequest
getHeaderNames
in interface HttpServletRequest
getIntHeader
in interface HttpServletRequest
getMethod
in interface HttpServletRequest
getPathInfo
in interface HttpServletRequest
getPathTranslated
in interface HttpServletRequest
getContextPath
in interface HttpServletRequest
getQueryString
in interface HttpServletRequest
getRemoteUser
in interface HttpServletRequest
isUserInRole
in interface HttpServletRequest
getUserPrincipal
in interface HttpServletRequest
getRequestedSessionId
in interface HttpServletRequest
getRequestURI
in interface HttpServletRequest
getRequestURL
in interface HttpServletRequest
getServletPath
in interface HttpServletRequest
getSession
in interface HttpServletRequest
getSession
in interface HttpServletRequest
changeSessionId
in interface HttpServletRequest
isRequestedSessionIdValid
in interface HttpServletRequest
isRequestedSessionIdFromCookie
in interface HttpServletRequest
isRequestedSessionIdFromURL
in interface HttpServletRequest
isRequestedSessionIdFromUrl
in interface HttpServletRequest
authenticate
in interface HttpServletRequest
IOException
ServletException
login
in interface HttpServletRequest
ServletException
logout
in interface HttpServletRequest
ServletException
getParts
in interface HttpServletRequest
IOException
ServletException
upgrade
in interface HttpServletRequest
IOException
ServletException
getPart
in interface HttpServletRequest
IOException
ServletException
getAttribute
in interface ServletRequest
getAttributeNames
in interface ServletRequest
getCharacterEncoding
in interface ServletRequest
setCharacterEncoding
in interface ServletRequest
getContentLength
in interface ServletRequest
getContentLengthLong
in interface ServletRequest
getContentType
in interface ServletRequest
getInputStream
in interface ServletRequest
IOException
getParameter
in interface ServletRequest
getParameterNames
in interface ServletRequest
getParameterValues
in interface ServletRequest
getParameterMap
in interface ServletRequest
getProtocol
in interface ServletRequest
getScheme
in interface ServletRequest
getServerName
in interface ServletRequest
getServerPort
in interface ServletRequest
getReader
in interface ServletRequest
IOException
getRemoteAddr
in interface ServletRequest
getRemoteHost
in interface ServletRequest
setAttribute
in interface ServletRequest
removeAttribute
in interface ServletRequest
getLocale
in interface ServletRequest
getLocales
in interface ServletRequest
isSecure
in interface ServletRequest
getRequestDispatcher
in interface ServletRequest
getRealPath
in interface ServletRequest
getRemotePort
in interface ServletRequest
getLocalName
in interface ServletRequest
getLocalAddr
in interface ServletRequest
getLocalPort
in interface ServletRequest
getServletContext
in interface ServletRequest
startAsync
in interface ServletRequest
IllegalStateException
startAsync
in interface ServletRequest
IllegalStateException
isAsyncStarted
in interface ServletRequest
isAsyncSupported
in interface ServletRequest
getAsyncContext
in interface ServletRequest
getDispatcherType
in interface ServletRequest