Package rife.servlet
Class HttpRequest
java.lang.Object
rife.servlet.HttpRequest
- All Implemented Interfaces:
Request
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetAttribute
(String name) getBody()
Retrieves the body of this request as a string.byte[]
Retrieves the body of this request as a byte array.Retrieves a cookie.Cookie[]
long
getDateHeader
(String name) Retrieves an uploaded file.getFiles()
Retrieves the files that were uploaded in this request.Retrieves all files that have been uploaded for a particular name.getHeaders
(String name) Retrieves the underlyingHttpServletRequest
.int
getIntHeader
(String name) Retrieves the parameters that were sent in this request.int
getServerRootUrl
(int port) Returns the root URL of the server that is running this web applications.getSession
(boolean create) boolean
hasAttribute
(String name) Checks if a request attribute exists.boolean
Checks whether a cookie is present.boolean
Checks if a particular file has been uploaded in this request.void
init()
boolean
isSecure()
void
removeAttribute
(String name) void
setAttribute
(String name, Object object)
-
Constructor Details
-
HttpRequest
- Throws:
EngineException
-
-
Method Details
-
init
public void init() -
getMethod
Description copied from interface:Request
-
getParameters
Description copied from interface:Request
Retrieves the parameters that were sent in this request.- Specified by:
getParameters
in interfaceRequest
- Returns:
- a
Map
with all the parameter names and values
-
getBody
Description copied from interface:Request
Retrieves the body of this request as a string. -
getBodyAsBytes
public byte[] getBodyAsBytes()Description copied from interface:Request
Retrieves the body of this request as a byte array.- Specified by:
getBodyAsBytes
in interfaceRequest
- Returns:
- the byte array of the request body
- See Also:
-
getFiles
Description copied from interface:Request
Retrieves the files that were uploaded in this request. -
hasFile
Description copied from interface:Request
Checks if a particular file has been uploaded in this request. -
getFile
Description copied from interface:Request
Retrieves an uploaded file. -
getFiles
Description copied from interface:Request
Retrieves all files that have been uploaded for a particular name. -
hasCookie
Description copied from interface:Request
Checks whether a cookie is present. -
getCookie
Description copied from interface:Request
Retrieves a cookie. -
getAttribute
Description copied from interface:Request
- Specified by:
getAttribute
in interfaceRequest
-
getCookies
Description copied from interface:Request
- Specified by:
getCookies
in interfaceRequest
-
hasAttribute
Description copied from interface:Request
Checks if a request attribute exists.- Specified by:
hasAttribute
in interfaceRequest
- Parameters:
name
- aString
specifying the name of the attributefalse
otherwise
-
getAttributeNames
Description copied from interface:Request
- Specified by:
getAttributeNames
in interfaceRequest
-
getCharacterEncoding
Description copied from interface:Request
- Specified by:
getCharacterEncoding
in interfaceRequest
-
getContentType
Description copied from interface:Request
- Specified by:
getContentType
in interfaceRequest
-
getDateHeader
Description copied from interface:Request
- Specified by:
getDateHeader
in interfaceRequest
-
getHeader
Description copied from interface:Request
-
getHeaderNames
Description copied from interface:Request
- Specified by:
getHeaderNames
in interfaceRequest
-
getHeaders
Description copied from interface:Request
- Specified by:
getHeaders
in interfaceRequest
-
getIntHeader
Description copied from interface:Request
- Specified by:
getIntHeader
in interfaceRequest
-
getLocale
Description copied from interface:Request
-
getLocales
Description copied from interface:Request
- Specified by:
getLocales
in interfaceRequest
-
getProtocol
Description copied from interface:Request
- Specified by:
getProtocol
in interfaceRequest
-
getRemoteAddr
Description copied from interface:Request
- Specified by:
getRemoteAddr
in interfaceRequest
-
getRemoteUser
Description copied from interface:Request
- Specified by:
getRemoteUser
in interfaceRequest
-
getRemoteHost
Description copied from interface:Request
- Specified by:
getRemoteHost
in interfaceRequest
-
getRequestDispatcher
Description copied from interface:Request
- Specified by:
getRequestDispatcher
in interfaceRequest
-
getSession
Description copied from interface:Request
- Specified by:
getSession
in interfaceRequest
-
getSession
Description copied from interface:Request
- Specified by:
getSession
in interfaceRequest
-
getServerPort
public int getServerPort()Description copied from interface:Request
- Specified by:
getServerPort
in interfaceRequest
-
getScheme
Description copied from interface:Request
-
getServerName
Description copied from interface:Request
- Specified by:
getServerName
in interfaceRequest
-
getContextPath
Description copied from interface:Request
- Specified by:
getContextPath
in interfaceRequest
-
isSecure
public boolean isSecure()Description copied from interface:Request
-
removeAttribute
Description copied from interface:Request
- Specified by:
removeAttribute
in interfaceRequest
-
setAttribute
Description copied from interface:Request
- Specified by:
setAttribute
in interfaceRequest
-
getServerRootUrl
Description copied from interface:Request
Returns the root URL of the server that is running this web applications.This includes the protocol, the server name and the server port, for example:
http://www.somehost.com:8080
.- Specified by:
getServerRootUrl
in interfaceRequest
- Returns:
- the server's root url
-
getHttpServletRequest
Description copied from interface:Request
Retrieves the underlyingHttpServletRequest
.- Specified by:
getHttpServletRequest
in interfaceRequest
- Returns:
- the underlying
HttpServletRequest
instance; ornull
if this request isn't backed byHttpServletRequest
-