Package | Description |
---|---|
ninja | |
ninja.diagnostics | |
ninja.exceptions | |
ninja.i18n | |
ninja.template | |
ninja.utils |
Modifier and Type | Class and Description |
---|---|
class |
AsyncResult
An async result
|
Modifier and Type | Method and Description |
---|---|
Result |
Result.addCookie(Cookie cookie) |
Result |
Result.addHeader(String headerName,
String headerContent) |
Result |
ControllerMethods.ControllerMethod0.apply() |
Result |
ControllerMethods.ControllerMethod1.apply(A a) |
Result |
ControllerMethods.ControllerMethod2.apply(A a,
B b) |
Result |
ControllerMethods.ControllerMethod3.apply(A a,
B b,
C c) |
Result |
ControllerMethods.ControllerMethod4.apply(A a,
B b,
C c,
D d) |
Result |
ControllerMethods.ControllerMethod5.apply(A a,
B b,
C c,
D d,
E e) |
Result |
ControllerMethods.ControllerMethod6.apply(A a,
B b,
C c,
D d,
E e,
F f) |
Result |
ControllerMethods.ControllerMethod7.apply(A a,
B b,
C c,
D d,
E e,
F f,
G g) |
Result |
ControllerMethods.ControllerMethod8.apply(A a,
B b,
C c,
D d,
E e,
F f,
G g,
H h) |
Result |
ControllerMethods.ControllerMethod9.apply(A a,
B b,
C c,
D d,
E e,
F f,
G g,
H h,
I i) |
Result |
ControllerMethods.ControllerMethod10.apply(A a,
B b,
C c,
D d,
E e,
F f,
G g,
H h,
I i,
J j) |
Result |
ControllerMethods.ControllerMethod11.apply(A a,
B b,
C c,
D d,
E e,
F f,
G g,
H h,
I i,
J j,
K k) |
Result |
ControllerMethods.ControllerMethod12.apply(A a,
B b,
C c,
D d,
E e,
F f,
G g,
H h,
I i,
J j,
K k,
L l) |
Result |
ControllerMethods.ControllerMethod13.apply(A a,
B b,
C c,
D d,
E e,
F f,
G g,
H h,
I i,
J j,
K k,
L l,
M m) |
Result |
ControllerMethods.ControllerMethod14.apply(A a,
B b,
C c,
D d,
E e,
F f,
G g,
H h,
I i,
J j,
K k,
L l,
M m,
N n) |
Result |
ControllerMethods.ControllerMethod15.apply(A a,
B b,
C c,
D d,
E e,
F f,
G g,
H h,
I i,
J j,
K k,
L l,
M m,
N n,
O o) |
static Result |
Results.badRequest() |
Result |
Result.charset(String charset) |
static Result |
Results.contentType(String contentType) |
Result |
Result.contentType(String contentType)
Sets the content type.
|
Result |
WrappedContext.controllerReturned() |
Result |
Context.controllerReturned() |
static Result |
Results.created(Optional<String> url) |
Result |
Result.doNotCacheContent()
This function sets
Cache-Control: no-cache, no-store
Date: (current date)
Expires: 1970
=> it therefore effectively forces the browser and every proxy in between
not to cache content.
|
Result |
Result.fallbackContentType(String fallbackContentType) |
Result |
Filter.filter(FilterChain filterChain,
Context context)
Filter the request.
|
Result |
SecureFilter.filter(FilterChain chain,
Context context) |
Result |
AuthenticityFilter.filter(FilterChain filterChain,
Context context) |
Result |
BasicAuthFilter.filter(FilterChain chain,
Context context) |
static Result |
Results.forbidden() |
Result |
NinjaDefault.getBadRequestResult(Context context,
BadRequestException exception) |
Result |
Ninja.getBadRequestResult(Context context,
BadRequestException exception)
Should handle cases where the client sent strange date that
led to an error.
|
Result |
NinjaDefault.getForbiddenResult(Context context) |
Result |
Ninja.getForbiddenResult(Context context)
Should handle cases where access is forbidden
Should lead to a html error 403 - forbidden
(and be used with the same mindset).
|
Result |
NinjaDefault.getForbiddenResult(Context context,
ForbiddenRequestException exception) |
Result |
Ninja.getForbiddenResult(Context context,
ForbiddenRequestException exception)
Should handle cases where access is forbidden
Should lead to a html error 403 - forbidden
(and be used with the same mindset).
|
Result |
NinjaDefault.getInternalServerErrorResult(Context context,
Exception exception)
Deprecated.
|
Result |
NinjaDefault.getInternalServerErrorResult(Context context,
Exception exception,
Result underlyingResult) |
Result |
Ninja.getInternalServerErrorResult(Context context,
Exception exception,
Result underlyingResult)
Should handle cases where an exception is thrown
when handling a route that let to an internal server error.
|
Result |
NinjaDefault.getNotFoundResult(Context context) |
Result |
Ninja.getNotFoundResult(Context context)
Should handle cases where no route can be found for a given request.
|
Result |
NinjaDefault.getNotFoundResult(Context context,
RequestNotFoundException exception) |
Result |
Ninja.getNotFoundResult(Context context,
RequestNotFoundException exception)
Should handle cases where no route can be found for a given request.
|
Result |
NinjaDefault.getRenderingExceptionResult(Context context,
RenderingException exception,
Result underlyingResult) |
Result |
Ninja.getRenderingExceptionResult(Context context,
RenderingException exception,
Result underlyingResult)
Should handle cases where a
RenderingException is thrown
when handling the rendering of a Result. |
Result |
NinjaDefault.getUnauthorizedResult(Context context) |
Result |
Ninja.getUnauthorizedResult(Context context)
Should handle cases where access is unauthorized
Should lead to a html error 401 - unauthorized
(and be used with the same mindset).
|
static Result |
Results.html() |
Result |
Result.html()
Set the content type of this result to
TEXT_HTML . |
static Result |
Results.internalServerError() |
static Result |
Results.json() |
Result |
Result.json()
Set the content type of this result to
APPLICATION_JSON . |
static Result |
Results.jsonp() |
Result |
Result.jsonp()
Set the content type of this result to
APPLICATION_JSONP . |
Result |
Result.jsonView(Class<?> jsonView)
Set the Jackson JSON View.
|
Result |
FilterChain.next(Context context)
Pass the request to the next filter
|
static Result |
Results.noContent() |
static Result |
Results.notFound() |
static Result |
Results.ok() |
Result |
NinjaDefault.onException(Context context,
Exception exception) |
Result |
Ninja.onException(Context context,
Exception exception)
This result should be used when an error occurs.
|
Result |
NinjaDefault.onException(Context context,
Exception exception,
Result underlyingResult) |
Result |
ReverseRouter.Builder.redirect()
Builds the result as a
ninja.Result redirect. |
static Result |
Results.redirect(String url)
A redirect that uses 303 see other.
|
Result |
Result.redirect(String url)
A redirect that uses 303 see other.
|
static Result |
Results.redirectTemporary(String url)
A redirect that uses 307 see other.
|
Result |
Result.redirectTemporary(String url)
A redirect that uses 307 see other.
|
Result |
Result.render(Map.Entry<String,Object> entry)
Handles following cases:
1) If this.renderable is null: a new HashMap is generated and this entry being added
to the map.
|
Result |
Result.render(Map<String,Object> mapToRender)
Replaces the object being passed by this result to the rendering engine
with this map.
|
Result |
Result.render(Object object)
This method handles two principal cases:
1) If the this.renderable of this result is null, the object passed is simply set as renderable
for this Result
2) If the this.renderable of this result is not null an new map is generated as
object to render and both the former renderable and the new object added to the map.
|
Result |
Result.render(Renderable renderable)
Sets this renderable as object to render.
|
Result |
Result.render(String key,
Object value)
Implicitly generates a hashmap as object being rendered and adds
this key, value pair.
|
Result |
Result.renderRaw(byte[] bytes)
This method directly renders the byte array to the output.
|
Result |
Result.renderRaw(String string)
Deprecated.
=> use text().render(string), html().render(string),
json().render(string), xml().render(string), or
contentType(type).render(string).
|
Result |
AssetsController.serveStatic()
Serves resources from the assets directory of your application.
|
Result |
AssetsController.serveWebJars()
Serves resources from the assets directory of your application.
|
Result |
Result.setContentType(String contentType)
Deprecated.
|
static Result |
Results.status(int statusCode) |
Result |
Result.status(int statusCode)
Set the status of this result.
|
Result |
Result.supportedContentType(String contentTypeSupportedByThisResult)
Will add a content type to the list of supported content types.
|
Result |
Result.supportedContentTypes(String... contentTypesSupportedByThisResult)
Will add the content types to the list of supported content types.
|
Result |
Result.template(String template)
Set the template to render.
|
static Result |
Results.text() |
Result |
Result.text()
Set the content type of this result to
TEXT_PLAIN . |
static Result |
Results.TODO() |
static Result |
Results.unauthorized() |
Result |
Result.unsetCookie(String name) |
static Result |
Results.webSocketContinue()
Instructs ninja (and the http container) that it is okay to continue with
the websocket handshake.
|
static Result |
Results.xml() |
Result |
Result.xml()
Set the content type of this result to
Result#APPLICATON_XML . |
Modifier and Type | Method and Description |
---|---|
ResponseStreams |
WrappedContext.finalizeHeaders(Result result) |
ResponseStreams |
Context.finalizeHeaders(Result result)
Finalizing the headers copies all stuff into the headers.
|
ResponseStreams |
WrappedContext.finalizeHeadersWithoutFlashAndSessionCookie(Result result) |
ResponseStreams |
Context.finalizeHeadersWithoutFlashAndSessionCookie(Result result)
Finalizing the headers copies all stuff into the headers.
|
Result |
NinjaDefault.getInternalServerErrorResult(Context context,
Exception exception,
Result underlyingResult) |
Result |
Ninja.getInternalServerErrorResult(Context context,
Exception exception,
Result underlyingResult)
Should handle cases where an exception is thrown
when handling a route that let to an internal server error.
|
Result |
NinjaDefault.getRenderingExceptionResult(Context context,
RenderingException exception,
Result underlyingResult) |
Result |
Ninja.getRenderingExceptionResult(Context context,
RenderingException exception,
Result underlyingResult)
Should handle cases where a
RenderingException is thrown
when handling the rendering of a Result. |
Result |
NinjaDefault.onException(Context context,
Exception exception,
Result underlyingResult) |
void |
Renderable.render(Context context,
Result result) |
void |
NinjaDefault.renderErrorResultAndCatchAndLogExceptions(Result result,
Context context) |
void |
Ninja.renderErrorResultAndCatchAndLogExceptions(Result result,
Context context)
Should be used to render an error.
|
void |
WrappedContext.returnResultAsync(Result result) |
void |
Context.returnResultAsync(Result result)
Indicate that request processing of an async request is complete.
|
void |
RouteBuilder.with(Result result)
Deprecated.
Use the functional interface methods to supply a new result
for each route request. Its recommended to use
() -> Results.redirect("/") . |
void |
RouteBuilderImpl.with(Result result)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected Message |
NinjaDefault.buildErrorMessage(Context context,
String errorTextKey,
String errorTextDefault,
Optional<Throwable> exception,
Optional<Result> underlyingResult) |
Modifier and Type | Method and Description |
---|---|
Result |
DiagnosticError.getUnderlyingResult() |
Modifier and Type | Method and Description |
---|---|
static DiagnosticErrorRenderer |
DiagnosticErrorRenderer.build(Context context,
Result result,
DiagnosticError diagnosticError) |
static DiagnosticError |
DiagnosticErrorBuilder.build500InternalServerErrorDiagnosticError(Throwable cause,
boolean tryToReadLinesFromSourceCode,
Result underlyingResult) |
static DiagnosticError |
DiagnosticErrorBuilder.buildDiagnosticError(String title,
Throwable throwable,
boolean tryToReadLinesFromSourceCode,
Result underlyingResult) |
static DiagnosticError |
DiagnosticErrorBuilder.buildDiagnosticError(String title,
Throwable throwable,
SourceSnippet snippet,
int lineNumberOfError,
Result underlyingResult) |
static DiagnosticError |
DiagnosticErrorBuilder.buildDiagnosticError(String title,
Throwable throwable,
String relativeSourcePath,
int lineNumberOfError,
Result underlyingResult) |
static DiagnosticError |
DiagnosticErrorBuilder.buildDiagnosticError(String title,
Throwable throwable,
String packageName,
String fileName,
int lineNumberOfError,
Result underlyingResult) |
void |
DiagnosticError.render(Context context,
Result result) |
void |
DiagnosticErrorRenderer.renderResult(Context context,
Result result) |
static void |
DiagnosticErrorRenderer.tryToRender(Context context,
Result result,
DiagnosticError diagnosticError,
boolean throwInternalServerExceptionOnError) |
Constructor and Description |
---|
DiagnosticError(String title,
Throwable throwable,
Result underlyingResult) |
DiagnosticError(String title,
Throwable throwable,
URI sourceLocation,
List<String> sourceLines,
int lineNumberOfSourceLines,
int lineNumberOfError,
Result underlyingResult) |
Modifier and Type | Method and Description |
---|---|
Result |
RenderingException.getResult() |
Constructor and Description |
---|
RenderingException(String message,
Throwable cause,
Result result,
String sourcePath,
int lineNumber) |
RenderingException(String message,
Throwable cause,
Result result,
String title,
String sourcePath,
int lineNumber) |
Modifier and Type | Method and Description |
---|---|
Result |
Lang.setLanguage(String locale,
Result result)
Force a language in Ninja framwork.
|
Result |
LangImpl.setLanguage(String locale,
Result result) |
Modifier and Type | Method and Description |
---|---|
void |
Lang.clearLanguage(Result result)
Clears the current language.
|
void |
LangImpl.clearLanguage(Result result) |
Result |
Lang.setLanguage(String locale,
Result result)
Force a language in Ninja framwork.
|
Result |
LangImpl.setLanguage(String locale,
Result result) |
Modifier and Type | Method and Description |
---|---|
Optional<String> |
Messages.get(String key,
Context context,
Optional<Result> result,
Object... parameter)
Get a translated string.
|
Optional<String> |
MessagesImpl.get(String key,
Context context,
Optional<Result> result,
Object... parameter) |
Map<Object,Object> |
Messages.getAll(Context context,
Optional<Result> result)
Returns all messages for the default language in that context / result.
|
Map<Object,Object> |
MessagesImpl.getAll(Context context,
Optional<Result> result) |
Optional<String> |
Lang.getLanguage(Context context,
Optional<Result> result)
Retrieve the current language or null if not set.
|
Optional<String> |
LangImpl.getLanguage(Context context,
Optional<Result> result) |
String |
Messages.getWithDefault(String key,
String defaultMessage,
Context context,
Optional<Result> result,
Object... params)
Gets a message for a message key.
|
String |
MessagesImpl.getWithDefault(String key,
String defaultMessage,
Context context,
Optional<Result> result,
Object... params) |
Modifier and Type | Method and Description |
---|---|
String |
TemplateEngineHelper.getTemplateForResult(Route route,
Result result,
String suffix) |
void |
TemplateEngineJson.invoke(Context context,
Result result) |
void |
TemplateEngineJsonP.invoke(Context context,
Result result) |
void |
TemplateEngineFreemarker.invoke(Context context,
Result result) |
void |
TemplateEngine.invoke(Context context,
Result result)
Render the given object to the given context
|
void |
TemplateEngineXml.invoke(Context context,
Result result) |
void |
TemplateEngineText.invoke(Context context,
Result result) |
void |
TemplateEngineFreemarker.throwRenderingException(Context context,
Result result,
Exception cause,
String knownTemplateSourcePath) |
Constructor and Description |
---|
TemplateEngineFreemarkerI18nMethod(Messages messages,
Context context,
Result result) |
Modifier and Type | Method and Description |
---|---|
void |
HttpCacheToolkitImpl.addEtag(Context context,
Result result,
Long lastModified) |
void |
HttpCacheToolkit.addEtag(Context context,
Result result,
Long lastModified)
Adds etag to result.
|
ResponseStreams |
AbstractContext.finalizeHeaders(Result result) |
protected ResponseStreams |
AbstractContext.finalizeHeaders(Result result,
Boolean handleFlashAndSessionCookie) |
ResponseStreams |
AbstractContext.finalizeHeadersWithoutFlashAndSessionCookie(Result result) |
void |
ResultHandler.handleResult(Result result,
Context context) |
Copyright © 2019 ninjaframework. All rights reserved.