public class SimpleHttpRequest
extends javax.servlet.http.HttpServletRequestWrapper
Constructor and Description |
---|
SimpleHttpRequest()
Instantiates a new simple http request.
|
Modifier and Type | Method and Description |
---|---|
void |
addHeader(String headerName,
String headerValue)
Adds the header.
|
void |
addParameter(String parameterName,
String parameterValue)
Adds the parameter.
|
int |
getContentLength() |
String |
getHeader(String headerName) |
Enumeration<String> |
getHeaderNames() |
String |
getMethod() |
String |
getParameter(String parameterName) |
String |
getQueryString() |
String |
getRemoteAddr() |
String |
getRemoteHost() |
int |
getRemotePort() |
String |
getRemoteUser() |
String |
getRequestURI() |
javax.servlet.http.HttpSession |
getSession() |
javax.servlet.http.HttpSession |
getSession(boolean create) |
Principal |
getUserPrincipal() |
static int |
nextRemotePort()
Next remote port.
|
static void |
resetRemotePort()
Reset remote port.
|
void |
setContentLength(int length)
Sets the content length.
|
void |
setMethod(String methodName)
Sets the method.
|
void |
setQueryString(String query)
Sets the query string.
|
void |
setRemoteAddr(String value)
Sets the remote addr.
|
void |
setRemoteHost(String value)
Sets the remote host.
|
void |
setRemoteUser(String username)
Sets the remote user.
|
void |
setRequestURI(String uri)
Sets the request uri.
|
void |
setUserPrincipal(Principal value)
Sets the user principal.
|
authenticate, changeSessionId, getAuthType, getContextPath, getCookies, getDateHeader, getHeaders, getIntHeader, getPart, getParts, getPathInfo, getPathTranslated, getRequestedSessionId, getRequestURL, getServletPath, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole, login, logout, upgrade
getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, removeAttribute, setAttribute, setCharacterEncoding, setRequest, startAsync, startAsync
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsync
public SimpleHttpRequest()
public static int nextRemotePort()
public static void resetRemotePort()
public void addHeader(String headerName, String headerValue)
headerName
- the header nameheaderValue
- the header valuepublic String getHeader(String headerName)
getHeader
in interface javax.servlet.http.HttpServletRequest
getHeader
in class javax.servlet.http.HttpServletRequestWrapper
public Enumeration<String> getHeaderNames()
getHeaderNames
in interface javax.servlet.http.HttpServletRequest
getHeaderNames
in class javax.servlet.http.HttpServletRequestWrapper
public String getMethod()
getMethod
in interface javax.servlet.http.HttpServletRequest
getMethod
in class javax.servlet.http.HttpServletRequestWrapper
public int getContentLength()
getContentLength
in interface javax.servlet.ServletRequest
getContentLength
in class javax.servlet.ServletRequestWrapper
public int getRemotePort()
getRemotePort
in interface javax.servlet.ServletRequest
getRemotePort
in class javax.servlet.ServletRequestWrapper
public void setMethod(String methodName)
methodName
- the new methodpublic void setContentLength(int length)
length
- the new content lengthpublic void setRemoteUser(String username)
username
- the new remote userpublic String getRemoteUser()
getRemoteUser
in interface javax.servlet.http.HttpServletRequest
getRemoteUser
in class javax.servlet.http.HttpServletRequestWrapper
public javax.servlet.http.HttpSession getSession()
getSession
in interface javax.servlet.http.HttpServletRequest
getSession
in class javax.servlet.http.HttpServletRequestWrapper
public javax.servlet.http.HttpSession getSession(boolean create)
getSession
in interface javax.servlet.http.HttpServletRequest
getSession
in class javax.servlet.http.HttpServletRequestWrapper
public String getQueryString()
getQueryString
in interface javax.servlet.http.HttpServletRequest
getQueryString
in class javax.servlet.http.HttpServletRequestWrapper
public void setQueryString(String query)
query
- the new query stringpublic void setRequestURI(String uri)
uri
- the new request uripublic String getRequestURI()
getRequestURI
in interface javax.servlet.http.HttpServletRequest
getRequestURI
in class javax.servlet.http.HttpServletRequestWrapper
public String getParameter(String parameterName)
getParameter
in interface javax.servlet.ServletRequest
getParameter
in class javax.servlet.ServletRequestWrapper
public void addParameter(String parameterName, String parameterValue)
parameterName
- the parameter nameparameterValue
- the parameter valuepublic String getRemoteHost()
getRemoteHost
in interface javax.servlet.ServletRequest
getRemoteHost
in class javax.servlet.ServletRequestWrapper
public void setRemoteHost(String value)
value
- the new remote hostpublic String getRemoteAddr()
getRemoteAddr
in interface javax.servlet.ServletRequest
getRemoteAddr
in class javax.servlet.ServletRequestWrapper
public void setRemoteAddr(String value)
value
- the new remote addrpublic Principal getUserPrincipal()
getUserPrincipal
in interface javax.servlet.http.HttpServletRequest
getUserPrincipal
in class javax.servlet.http.HttpServletRequestWrapper
public void setUserPrincipal(Principal value)
value
- the new user principalCopyright © 2010–2015 com.github.dblock. All rights reserved.