|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Context
Nested Class Summary | |
---|---|
static class |
Context.HTTP_STATUS
Deprecated. |
Field Summary | |
---|---|
static String |
CONTENT_TYPE
Content-Type: ... parameter for response. |
Method Summary | ||
---|---|---|
Context |
addCookie(Cookie cookie)
Add the given cookie to the response |
|
void |
asyncRequestComplete()
Indicate that processing this request is complete. |
|
Result |
controllerReturned()
|
|
ResponseStreams |
finalizeHeaders(Result result)
Finalizing the headers copies all stuff into the headers. |
|
String |
getCookieValue(String name)
Get the cookie value from the request, if defined |
|
org.apache.commons.fileupload.FileItemIterator |
getFileItemIterator()
Gets the FileItemIterator of the input. |
|
FlashCookie |
getFlashCookie()
Returns the flash cookie. |
|
String |
getHeader(String name)
Get the request header with the given name |
|
Map<String,String> |
getHeaders()
Get all the headers from the request |
|
javax.servlet.http.HttpServletRequest |
getHttpServletRequest()
Deprecated. |
|
javax.servlet.http.HttpServletResponse |
getHttpServletResponse()
Deprecated. |
|
InputStream |
getInputStream()
Get the input stream to read the request. |
|
String |
getParameter(String name)
Get the parameter with the given key from the request. |
|
String |
getParameter(String name,
String defaultValue)
Same like getParameter(String) , but returns given defaultValue
instead of null in case parameter cannot be found. |
|
Integer |
getParameterAsInteger(String name)
Same like getParameter(String) , but converts the
parameter to Integer if found. |
|
Integer |
getParameterAsInteger(String name,
Integer defaultValue)
Same like getParameter(String, String) , but converts the
parameter to Integer if found. |
|
Map<String,String[]> |
getParameters()
Get all the parameters from the request |
|
String |
getPathParameter(String name)
Get the path parameter for the given key. |
|
Integer |
getPathParameterAsInteger(String key)
Get the path parameter for the given key and convert it to Integer. |
|
String |
getPathParameterEncoded(String name)
Get the path parameter for the given key. |
|
BufferedReader |
getReader()
Get the reader to read the request. |
|
String |
getRequestContentType()
Content type of the request we got. |
|
String |
getRequestPath()
Returns the path that Ninja should act upon. |
|
String |
getRequestUri()
Deprecated. |
|
Route |
getRoute()
Get the route for this context |
|
SessionCookie |
getSessionCookie()
Returns the client side session. |
|
Validation |
getValidation()
Get the validation context |
|
void |
handleAsync()
Indicate that this request is going to be handled asynchronously |
|
boolean |
isMultipart()
Check if request is of type multipart. |
|
|
parseBody(Class<T> classOfT)
This will give you the request body nicely parsed. |
|
void |
returnResultAsync(Result result)
Indicate that request processing of an async request is complete. |
Field Detail |
---|
static final String CONTENT_TYPE
Method Detail |
---|
String getRequestContentType()
@Deprecated String getRequestUri()
String getRequestPath()
FlashCookie getFlashCookie()
SessionCookie getSessionCookie()
Context addCookie(Cookie cookie)
cookie
- The cookie to add
@Deprecated javax.servlet.http.HttpServletRequest getHttpServletRequest()
@Deprecated javax.servlet.http.HttpServletResponse getHttpServletResponse()
String getParameter(String name)
name
- The key of the parameter
String getParameter(String name, String defaultValue)
getParameter(String)
, but returns given defaultValue
instead of null in case parameter cannot be found.
The parameter is decoded by default.
name
- The name of the post or query parameterdefaultValue
- A default value if parameter not found.
Integer getParameterAsInteger(String name)
getParameter(String)
, but converts the
parameter to Integer if found.
The parameter is decoded by default.
name
- The name of the post or query parameter
Integer getParameterAsInteger(String name, Integer defaultValue)
getParameter(String, String)
, but converts the
parameter to Integer if found.
The parameter is decoded by default.
name
- The name of the post or query parameterdefaultValue
- A default value if parameter not found.
String getPathParameter(String name)
name
- The name of the path parameter in a route. Eg /{myName}/rest/of/url
String getPathParameterEncoded(String name)
name
- The name of the path parameter in a route. Eg /{myName}/rest/of/url
Integer getPathParameterAsInteger(String key)
key
- the key of the path parameter
Map<String,String[]> getParameters()
String getHeader(String name)
Map<String,String> getHeaders()
String getCookieValue(String name)
name
- The name of the cookie
<T> T parseBody(Class<T> classOfT)
BodyParserEngine
BodyParserEngineJson
and BodyParserEngineManager
classOfT
- The class of the result.
void handleAsync()
void returnResultAsync(Result result)
void asyncRequestComplete()
Result controllerReturned()
ResponseStreams finalizeHeaders(Result result)
result
-
InputStream getInputStream() throws IOException
IOException
BufferedReader getReader() throws IOException
IOException
Route getRoute()
boolean isMultipart()
org.apache.commons.fileupload.FileItemIterator getFileItemIterator()
Validation getValidation()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |