public class MockHttpServletRequest
extends java.lang.Object
implements javax.servlet.http.HttpServletRequest
Constructor and Description |
---|
MockHttpServletRequest(javax.servlet.http.HttpSession session) |
MockHttpServletRequest(javax.servlet.http.HttpSession session,
java.lang.String scheme,
java.lang.String serverName,
int serverPort,
java.lang.String contextPath,
java.lang.String servletPath,
java.lang.String pathInfo,
java.lang.String queryString,
java.util.Hashtable parameterMap,
java.util.HashMap attributeMap,
java.util.HashMap headerMap) |
MockHttpServletRequest(javax.servlet.http.HttpSession session,
java.lang.String scheme,
java.lang.String serverName,
int serverPort,
java.lang.String contextPath,
java.lang.String servletPath,
java.lang.String pathInfo,
java.lang.String queryString,
java.util.Hashtable parameterMap,
java.util.HashMap attributeMap,
java.util.HashMap headerMap,
java.lang.String method,
java.lang.String remoteAddr) |
Modifier and Type | Method and Description |
---|---|
boolean |
authenticate(javax.servlet.http.HttpServletResponse arg0) |
java.lang.String |
changeSessionId() |
void |
clearAttributes() |
javax.servlet.AsyncContext |
getAsyncContext() |
java.lang.Object |
getAttribute(java.lang.String name) |
java.util.Enumeration |
getAttributeNames() |
java.lang.String |
getAuthType() |
java.lang.String |
getCharacterEncoding() |
int |
getContentLength() |
long |
getContentLengthLong() |
java.lang.String |
getContentType() |
java.lang.String |
getContextPath() |
javax.servlet.http.Cookie[] |
getCookies() |
long |
getDateHeader(java.lang.String name) |
javax.servlet.DispatcherType |
getDispatcherType() |
java.lang.String |
getHeader(java.lang.String name) |
java.util.Enumeration |
getHeaderNames() |
java.util.Enumeration |
getHeaders(java.lang.String name) |
javax.servlet.ServletInputStream |
getInputStream() |
int |
getIntHeader(java.lang.String name) |
java.lang.String |
getLocalAddr() |
java.util.Locale |
getLocale() |
java.util.Enumeration |
getLocales() |
java.lang.String |
getLocalName() |
int |
getLocalPort() |
java.lang.String |
getMethod() |
java.lang.String |
getParameter(java.lang.String name) |
java.util.Map |
getParameterMap() |
java.util.Enumeration |
getParameterNames() |
java.lang.String[] |
getParameterValues(java.lang.String name) |
javax.servlet.http.Part |
getPart(java.lang.String arg0) |
java.util.Collection<javax.servlet.http.Part> |
getParts() |
java.lang.String |
getPathInfo() |
java.lang.String |
getPathTranslated() |
java.lang.String |
getProtocol() |
java.lang.String |
getQueryString() |
java.io.BufferedReader |
getReader() |
java.lang.String |
getRealPath(java.lang.String path) |
java.lang.String |
getRemoteAddr() |
java.lang.String |
getRemoteHost() |
int |
getRemotePort() |
java.lang.String |
getRemoteUser() |
javax.servlet.RequestDispatcher |
getRequestDispatcher(java.lang.String path) |
java.lang.String |
getRequestedSessionId() |
java.lang.String |
getRequestURI() |
java.lang.StringBuffer |
getRequestURL() |
java.lang.String |
getScheme() |
java.lang.String |
getServerName() |
int |
getServerPort() |
javax.servlet.ServletContext |
getServletContext() |
java.lang.String |
getServletPath() |
javax.servlet.http.HttpSession |
getSession() |
javax.servlet.http.HttpSession |
getSession(boolean create) |
java.security.Principal |
getUserPrincipal() |
boolean |
isAsyncStarted() |
boolean |
isAsyncSupported() |
boolean |
isRequestedSessionIdFromCookie() |
boolean |
isRequestedSessionIdFromUrl() |
boolean |
isRequestedSessionIdFromURL() |
boolean |
isRequestedSessionIdValid() |
boolean |
isSecure() |
boolean |
isUserInRole(java.lang.String role) |
void |
login(java.lang.String arg0,
java.lang.String arg1) |
void |
logout() |
void |
removeAttribute(java.lang.String name) |
void |
removeHeader(java.lang.String name) |
void |
setAttribute(java.lang.String name,
java.lang.Object o) |
void |
setCharacterEncoding(java.lang.String env) |
void |
setCookies(javax.servlet.http.Cookie[] cookies) |
void |
setHeader(java.lang.String name,
java.lang.String value) |
void |
setMethod(java.lang.String method) |
void |
setQueryString(java.lang.String queryString) |
void |
setRemoteAddr(java.lang.String remoteAddr) |
void |
setServerName(java.lang.String serverName) |
javax.servlet.AsyncContext |
startAsync() |
javax.servlet.AsyncContext |
startAsync(javax.servlet.ServletRequest arg0,
javax.servlet.ServletResponse arg1) |
<T extends javax.servlet.http.HttpUpgradeHandler> |
upgrade(java.lang.Class<T> arg0) |
public MockHttpServletRequest(javax.servlet.http.HttpSession session)
public MockHttpServletRequest(javax.servlet.http.HttpSession session, java.lang.String scheme, java.lang.String serverName, int serverPort, java.lang.String contextPath, java.lang.String servletPath, java.lang.String pathInfo, java.lang.String queryString, java.util.Hashtable parameterMap, java.util.HashMap attributeMap, java.util.HashMap headerMap)
public MockHttpServletRequest(javax.servlet.http.HttpSession session, java.lang.String scheme, java.lang.String serverName, int serverPort, java.lang.String contextPath, java.lang.String servletPath, java.lang.String pathInfo, java.lang.String queryString, java.util.Hashtable parameterMap, java.util.HashMap attributeMap, java.util.HashMap headerMap, java.lang.String method, java.lang.String remoteAddr)
public void setServerName(java.lang.String serverName)
public void setQueryString(java.lang.String queryString)
public void setMethod(java.lang.String method)
public void setRemoteAddr(java.lang.String remoteAddr)
public void clearAttributes()
public java.lang.String getScheme()
getScheme
in interface javax.servlet.ServletRequest
public java.lang.String getServerName()
getServerName
in interface javax.servlet.ServletRequest
public int getServerPort()
getServerPort
in interface javax.servlet.ServletRequest
public java.lang.String getContextPath()
getContextPath
in interface javax.servlet.http.HttpServletRequest
public java.lang.String getServletPath()
getServletPath
in interface javax.servlet.http.HttpServletRequest
public java.lang.String getPathInfo()
getPathInfo
in interface javax.servlet.http.HttpServletRequest
public java.lang.String getQueryString()
getQueryString
in interface javax.servlet.http.HttpServletRequest
public java.util.Map getParameterMap()
getParameterMap
in interface javax.servlet.ServletRequest
public java.util.Enumeration getParameterNames()
getParameterNames
in interface javax.servlet.ServletRequest
public java.lang.String[] getParameterValues(java.lang.String name)
getParameterValues
in interface javax.servlet.ServletRequest
public java.lang.String getParameter(java.lang.String name)
getParameter
in interface javax.servlet.ServletRequest
public java.lang.Object getAttribute(java.lang.String name)
getAttribute
in interface javax.servlet.ServletRequest
public void setAttribute(java.lang.String name, java.lang.Object o)
setAttribute
in interface javax.servlet.ServletRequest
public void removeAttribute(java.lang.String name)
removeAttribute
in interface javax.servlet.ServletRequest
public java.util.Enumeration getAttributeNames()
getAttributeNames
in interface javax.servlet.ServletRequest
public javax.servlet.http.HttpSession getSession()
getSession
in interface javax.servlet.http.HttpServletRequest
public javax.servlet.http.HttpSession getSession(boolean create)
getSession
in interface javax.servlet.http.HttpServletRequest
public java.lang.String getHeader(java.lang.String name)
getHeader
in interface javax.servlet.http.HttpServletRequest
public java.util.Enumeration getHeaderNames()
getHeaderNames
in interface javax.servlet.http.HttpServletRequest
public void setHeader(java.lang.String name, java.lang.String value)
public void removeHeader(java.lang.String name)
public java.lang.String getRequestURI()
getRequestURI
in interface javax.servlet.http.HttpServletRequest
public java.util.Enumeration getHeaders(java.lang.String name)
getHeaders
in interface javax.servlet.http.HttpServletRequest
public int getIntHeader(java.lang.String name)
getIntHeader
in interface javax.servlet.http.HttpServletRequest
public long getDateHeader(java.lang.String name)
getDateHeader
in interface javax.servlet.http.HttpServletRequest
public java.lang.String getAuthType()
getAuthType
in interface javax.servlet.http.HttpServletRequest
public javax.servlet.http.Cookie[] getCookies()
getCookies
in interface javax.servlet.http.HttpServletRequest
public void setCookies(javax.servlet.http.Cookie[] cookies)
public java.lang.String getMethod()
getMethod
in interface javax.servlet.http.HttpServletRequest
public java.lang.String getPathTranslated()
getPathTranslated
in interface javax.servlet.http.HttpServletRequest
public java.lang.String getRealPath(java.lang.String path)
getRealPath
in interface javax.servlet.ServletRequest
public java.lang.String getRemoteUser()
getRemoteUser
in interface javax.servlet.http.HttpServletRequest
public java.lang.String getRequestedSessionId()
getRequestedSessionId
in interface javax.servlet.http.HttpServletRequest
public java.lang.StringBuffer getRequestURL()
getRequestURL
in interface javax.servlet.http.HttpServletRequest
public java.security.Principal getUserPrincipal()
getUserPrincipal
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdFromCookie()
isRequestedSessionIdFromCookie
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdFromUrl()
isRequestedSessionIdFromUrl
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdFromURL()
isRequestedSessionIdFromURL
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdValid()
isRequestedSessionIdValid
in interface javax.servlet.http.HttpServletRequest
public boolean isUserInRole(java.lang.String role)
isUserInRole
in interface javax.servlet.http.HttpServletRequest
public java.lang.String getCharacterEncoding()
getCharacterEncoding
in interface javax.servlet.ServletRequest
public int getContentLength()
getContentLength
in interface javax.servlet.ServletRequest
public java.lang.String getContentType()
getContentType
in interface javax.servlet.ServletRequest
public javax.servlet.ServletInputStream getInputStream() throws java.io.IOException
getInputStream
in interface javax.servlet.ServletRequest
java.io.IOException
public java.util.Locale getLocale()
getLocale
in interface javax.servlet.ServletRequest
public java.util.Enumeration getLocales()
getLocales
in interface javax.servlet.ServletRequest
public java.lang.String getProtocol()
getProtocol
in interface javax.servlet.ServletRequest
public java.io.BufferedReader getReader() throws java.io.IOException, java.lang.IllegalStateException
getReader
in interface javax.servlet.ServletRequest
java.io.IOException
java.lang.IllegalStateException
public java.lang.String getRemoteAddr()
getRemoteAddr
in interface javax.servlet.ServletRequest
public java.lang.String getRemoteHost()
getRemoteHost
in interface javax.servlet.ServletRequest
public int getRemotePort()
getRemotePort
in interface javax.servlet.ServletRequest
public javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String path)
getRequestDispatcher
in interface javax.servlet.ServletRequest
public boolean isSecure()
isSecure
in interface javax.servlet.ServletRequest
public void setCharacterEncoding(java.lang.String env) throws java.io.UnsupportedEncodingException
setCharacterEncoding
in interface javax.servlet.ServletRequest
java.io.UnsupportedEncodingException
public java.lang.String getLocalAddr()
getLocalAddr
in interface javax.servlet.ServletRequest
public java.lang.String getLocalName()
getLocalName
in interface javax.servlet.ServletRequest
public int getLocalPort()
getLocalPort
in interface javax.servlet.ServletRequest
public javax.servlet.ServletContext getServletContext()
getServletContext
in interface javax.servlet.ServletRequest
public boolean isAsyncStarted()
isAsyncStarted
in interface javax.servlet.ServletRequest
public boolean isAsyncSupported()
isAsyncSupported
in interface javax.servlet.ServletRequest
public boolean authenticate(javax.servlet.http.HttpServletResponse arg0) throws java.io.IOException, javax.servlet.ServletException
authenticate
in interface javax.servlet.http.HttpServletRequest
java.io.IOException
javax.servlet.ServletException
public void login(java.lang.String arg0, java.lang.String arg1) throws javax.servlet.ServletException
login
in interface javax.servlet.http.HttpServletRequest
javax.servlet.ServletException
public void logout() throws javax.servlet.ServletException
logout
in interface javax.servlet.http.HttpServletRequest
javax.servlet.ServletException
public long getContentLengthLong()
getContentLengthLong
in interface javax.servlet.ServletRequest
public java.lang.String changeSessionId()
changeSessionId
in interface javax.servlet.http.HttpServletRequest
public <T extends javax.servlet.http.HttpUpgradeHandler> T upgrade(java.lang.Class<T> arg0) throws java.io.IOException, javax.servlet.ServletException
upgrade
in interface javax.servlet.http.HttpServletRequest
java.io.IOException
javax.servlet.ServletException
public javax.servlet.AsyncContext getAsyncContext()
getAsyncContext
in interface javax.servlet.ServletRequest
public javax.servlet.DispatcherType getDispatcherType()
getDispatcherType
in interface javax.servlet.ServletRequest
public javax.servlet.AsyncContext startAsync()
startAsync
in interface javax.servlet.ServletRequest
public javax.servlet.AsyncContext startAsync(javax.servlet.ServletRequest arg0, javax.servlet.ServletResponse arg1)
startAsync
in interface javax.servlet.ServletRequest
public javax.servlet.http.Part getPart(java.lang.String arg0) throws java.io.IOException, java.lang.IllegalStateException, javax.servlet.ServletException
getPart
in interface javax.servlet.http.HttpServletRequest
java.io.IOException
java.lang.IllegalStateException
javax.servlet.ServletException
public java.util.Collection<javax.servlet.http.Part> getParts() throws java.io.IOException, java.lang.IllegalStateException, javax.servlet.ServletException
getParts
in interface javax.servlet.http.HttpServletRequest
java.io.IOException
java.lang.IllegalStateException
javax.servlet.ServletException
Copyright © 2001-2018 Jalios SA. All Rights Reserved.