| Modifier | Constructor and Description |
|---|---|
protected |
DefaultStatus()
Deprecated.
CDI eyes only
|
|
DefaultStatus(javax.servlet.http.HttpServletResponse response,
Result result,
Configuration config,
Proxifier proxifier,
Router router) |
| Modifier and Type | Method and Description |
|---|---|
void |
accepted()
Return Accepted (202) Status
|
void |
badRequest(List<?> errors)
Returns a Bad Request (400) status
Notifies the client that he should not try to execute the same request
again: part of its representation is somehow invalid.
|
void |
badRequest(String message)
Returns a Bad Request (400) status
Notifies the client that he should not try to execute the same request
again: part of its representation is somehow invalid.
|
void |
conflict()
Returns a Conflict (409) status
|
void |
created()
Returns a Created status (201)
|
void |
created(String location)
Sets the status to 201 and sets the location to the server's location +
the location content.
created("/order/2") ==> http://localhost:8080/my_context/order/2 |
void |
forbidden(String message)
Returns a Forbidden (403) status.
|
void |
header(String key,
String value) |
void |
methodNotAllowed(EnumSet<HttpMethod> allowedMethods)
Returns a Method Not Allowed (405) status
|
<T> T |
movedPermanentlyTo(Class<T> controller)
same as movedPermanentlyTo(String), but will use the url for
controller.method(args);
Example:
result.use(status()).movedPermanentlyTo(ClientsController.class).list();
|
void |
movedPermanentlyTo(String location)
Send redirect with Moved Permanently (301) Header Example:
result.use(status()).movedPermanentlyTo("/clients"); will move to
/{contextPath}/clients
|
void |
noContent()
Returns a No Content status (204)
|
void |
notAcceptable()
The accepted media type is not supported.(406)
|
void |
notFound()
Returns a Not Found (404) status
|
void |
notImplemented()
Return Not implemented (501) Status
|
void |
notModified()
Returns a Not Modified (304) status
|
void |
ok()
Returns a Ok status (200)
|
void |
unsupportedMediaType(String message)
The media type sent to the server is not supported.(415)
|
protected DefaultStatus()
@Inject
public DefaultStatus(javax.servlet.http.HttpServletResponse response,
Result result,
Configuration config,
Proxifier proxifier,
Router router)
public void notFound()
Statuspublic void created()
Statuspublic void created(String location)
Statuspublic void ok()
Statuspublic void conflict()
Statuspublic void methodNotAllowed(EnumSet<HttpMethod> allowedMethods)
StatusmethodNotAllowed in interface StatusallowedMethods - the allowed methods for this URIpublic void movedPermanentlyTo(String location)
StatusmovedPermanentlyTo in interface Statuslocation - absolute uri to redirectpublic <T> T movedPermanentlyTo(Class<T> controller)
StatusmovedPermanentlyTo in interface Statuspublic void unsupportedMediaType(String message)
StatusunsupportedMediaType in interface Statuspublic void badRequest(String message)
StatusbadRequest in interface Statuspublic void badRequest(List<?> errors)
Status
result.use(representation()).from(errors, "errors").serialize();
badRequest in interface Statuspublic void forbidden(String message)
Statuspublic void noContent()
Statuspublic void notAcceptable()
StatusnotAcceptable in interface Statuspublic void accepted()
Statuspublic void notModified()
StatusnotModified in interface Statuspublic void notImplemented()
StatusnotImplemented in interface StatusCopyright © 2014 Caelum. All rights reserved.