public class MockHttpServletRequest extends Object implements javax.servlet.http.HttpServletRequest
HttpServletRequest.| Constructor and Description |
|---|
MockHttpServletRequest() |
public void resetAll()
public void addAttributeListener(javax.servlet.ServletRequestAttributeListener listener)
public String getParameter(String key)
getParameter in interface javax.servlet.ServletRequestpublic void clearParameters()
public String[] getParameterValues(String key)
getParameterValues in interface javax.servlet.ServletRequestpublic void setupAddParameter(String key, String[] values)
key - the parameter keyvalues - the parameters valuespublic void setupAddParameter(String key, String value)
key - the parameter keyvalue - the parameters valuepublic Enumeration getParameterNames()
getParameterNames in interface javax.servlet.ServletRequestpublic Map getParameterMap()
getParameterMap in interface javax.servlet.ServletRequestpublic void clearAttributes()
public Object getAttribute(String key)
getAttribute in interface javax.servlet.ServletRequestpublic Enumeration getAttributeNames()
getAttributeNames in interface javax.servlet.ServletRequestpublic void removeAttribute(String key)
removeAttribute in interface javax.servlet.ServletRequestpublic void setAttribute(String key, Object value)
setAttribute in interface javax.servlet.ServletRequestpublic javax.servlet.http.HttpSession getSession()
getSession in interface javax.servlet.http.HttpServletRequestpublic javax.servlet.http.HttpSession getSession(boolean create)
getSession in interface javax.servlet.http.HttpServletRequestpublic void setSession(javax.servlet.http.HttpSession session)
HttpSession.session - the HttpSessionpublic javax.servlet.RequestDispatcher getRequestDispatcher(String path)
getRequestDispatcher in interface javax.servlet.ServletRequestpublic Map getRequestDispatcherMap()
RequestDispatcher objects. The specified path
maps to the corresponding RequestDispatcher object.RequestDispatcher objectspublic void clearRequestDispatcherMap()
RequestDispatcher objects.public void setRequestDispatcher(String path, javax.servlet.RequestDispatcher dispatcher)
RequestDispatcher that will be returned when calling
getRequestDispatcher(java.lang.String) with the specified path. If no RequestDispatcher
is set for the specified path, getRequestDispatcher(java.lang.String) automatically creates a
new one.path - the path for the RequestDispatcherdispatcher - the RequestDispatcher objectpublic Locale getLocale()
getLocale in interface javax.servlet.ServletRequestpublic Enumeration getLocales()
getLocales in interface javax.servlet.ServletRequestpublic void addLocale(Locale locale)
public void addLocales(List localeList)
public String getMethod()
getMethod in interface javax.servlet.http.HttpServletRequestpublic void setMethod(String method)
public String getAuthType()
getAuthType in interface javax.servlet.http.HttpServletRequestpublic void setAuthType(String authType)
public long getDateHeader(String key)
getDateHeader in interface javax.servlet.http.HttpServletRequestpublic String getHeader(String key)
getHeader in interface javax.servlet.http.HttpServletRequestpublic Enumeration getHeaderNames()
getHeaderNames in interface javax.servlet.http.HttpServletRequestpublic Enumeration getHeaders(String key)
getHeaders in interface javax.servlet.http.HttpServletRequestpublic int getIntHeader(String key)
getIntHeader in interface javax.servlet.http.HttpServletRequestpublic void clearHeaders()
public String getContextPath()
getContextPath in interface javax.servlet.http.HttpServletRequestpublic void setContextPath(String contextPath)
public String getPathInfo()
getPathInfo in interface javax.servlet.http.HttpServletRequestpublic void setPathInfo(String pathInfo)
public String getPathTranslated()
getPathTranslated in interface javax.servlet.http.HttpServletRequestpublic void setPathTranslated(String pathTranslated)
public String getQueryString()
getQueryString in interface javax.servlet.http.HttpServletRequestpublic void setQueryString(String queryString)
public String getRequestURI()
getRequestURI in interface javax.servlet.http.HttpServletRequestpublic void setRequestURI(String requestUri)
public StringBuffer getRequestURL()
getRequestURL in interface javax.servlet.http.HttpServletRequestpublic void setRequestURL(String requestUrl)
public String getServletPath()
getServletPath in interface javax.servlet.http.HttpServletRequestpublic void setServletPath(String servletPath)
public Principal getUserPrincipal()
getUserPrincipal in interface javax.servlet.http.HttpServletRequestpublic void setUserPrincipal(Principal principal)
public String getRemoteUser()
getRemoteUser in interface javax.servlet.http.HttpServletRequestpublic void setRemoteUser(String remoteUser)
public javax.servlet.http.Cookie[] getCookies()
getCookies in interface javax.servlet.http.HttpServletRequestpublic void addCookie(javax.servlet.http.Cookie cookie)
public String getRequestedSessionId()
getRequestedSessionId in interface javax.servlet.http.HttpServletRequestpublic boolean isRequestedSessionIdFromCookie()
isRequestedSessionIdFromCookie in interface javax.servlet.http.HttpServletRequestpublic boolean isRequestedSessionIdFromUrl()
isRequestedSessionIdFromUrl in interface javax.servlet.http.HttpServletRequestpublic boolean isRequestedSessionIdFromURL()
isRequestedSessionIdFromURL in interface javax.servlet.http.HttpServletRequestpublic void setRequestedSessionIdFromCookie(boolean requestedSessionIdIsFromCookie)
public boolean isRequestedSessionIdValid()
isRequestedSessionIdValid in interface javax.servlet.http.HttpServletRequestpublic boolean isUserInRole(String role)
isUserInRole in interface javax.servlet.http.HttpServletRequestpublic void setUserInRole(String role, boolean isInRole)
public String getCharacterEncoding()
getCharacterEncoding in interface javax.servlet.ServletRequestpublic void setCharacterEncoding(String characterEncoding) throws UnsupportedEncodingException
setCharacterEncoding in interface javax.servlet.ServletRequestUnsupportedEncodingExceptionpublic int getContentLength()
getContentLength in interface javax.servlet.ServletRequestpublic void setContentLength(int contentLength)
public String getContentType()
getContentType in interface javax.servlet.ServletRequestpublic void setContentType(String contentType)
public String getProtocol()
getProtocol in interface javax.servlet.ServletRequestpublic void setProtocol(String protocol)
public String getServerName()
getServerName in interface javax.servlet.ServletRequestpublic void setServerName(String serverName)
public int getServerPort()
getServerPort in interface javax.servlet.ServletRequestpublic void setServerPort(int serverPort)
public String getScheme()
getScheme in interface javax.servlet.ServletRequestpublic void setScheme(String scheme)
public String getRemoteAddr()
getRemoteAddr in interface javax.servlet.ServletRequestpublic void setRemoteAddr(String remoteAddr)
public String getRemoteHost()
getRemoteHost in interface javax.servlet.ServletRequestpublic void setRemoteHost(String remoteHost)
public BufferedReader getReader() throws IOException
getReader in interface javax.servlet.ServletRequestIOExceptionpublic javax.servlet.ServletInputStream getInputStream()
throws IOException
getInputStream in interface javax.servlet.ServletRequestIOExceptionpublic void setBodyContent(byte[] data)
public void setBodyContent(String bodyContent)
public String getRealPath(String path)
getRealPath in interface javax.servlet.ServletRequestpublic boolean isSecure()
isSecure in interface javax.servlet.ServletRequestpublic String getLocalAddr()
getLocalAddr in interface javax.servlet.ServletRequestpublic void setLocalAddr(String localAddr)
public String getLocalName()
getLocalName in interface javax.servlet.ServletRequestpublic void setLocalName(String localName)
public int getLocalPort()
getLocalPort in interface javax.servlet.ServletRequestpublic void setLocalPort(int localPort)
public int getRemotePort()
getRemotePort in interface javax.servlet.ServletRequestpublic void setRemotePort(int remotePort)
public boolean isAsyncSupported()
public void setAsyncSupported(boolean isAsyncSupported)
Copyright © 2003-2015. All Rights Reserved.