Uses of Class
ninja.Result
-
Packages that use Result Package Description ninja ninja.diagnostics ninja.exceptions ninja.i18n ninja.template ninja.utils -
-
Uses of Result in ninja
Subclasses of Result in ninja Modifier and Type Class Description classAsyncResultAn async resultMethods in ninja that return Result Modifier and Type Method Description ResultResult. addCookie(Cookie cookie)ResultResult. addHeader(String headerName, String headerContent)ResultControllerMethods.ControllerMethod0. apply()ResultControllerMethods.ControllerMethod1. apply(A a)ResultControllerMethods.ControllerMethod10. apply(A a, B b, C c, D d, E e, F f, G g, H h, I i, J j)ResultControllerMethods.ControllerMethod11. apply(A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k)ResultControllerMethods.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)ResultControllerMethods.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)ResultControllerMethods.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)ResultControllerMethods.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)ResultControllerMethods.ControllerMethod2. apply(A a, B b)ResultControllerMethods.ControllerMethod3. apply(A a, B b, C c)ResultControllerMethods.ControllerMethod4. apply(A a, B b, C c, D d)ResultControllerMethods.ControllerMethod5. apply(A a, B b, C c, D d, E e)ResultControllerMethods.ControllerMethod6. apply(A a, B b, C c, D d, E e, F f)ResultControllerMethods.ControllerMethod7. apply(A a, B b, C c, D d, E e, F f, G g)ResultControllerMethods.ControllerMethod8. apply(A a, B b, C c, D d, E e, F f, G g, H h)ResultControllerMethods.ControllerMethod9. apply(A a, B b, C c, D d, E e, F f, G g, H h, I i)static ResultResults. badRequest()ResultResult. charset(String charset)ResultResult. contentType(String contentType)Sets the content type.static ResultResults. contentType(String contentType)ResultContext. controllerReturned()ResultWrappedContext. controllerReturned()static ResultResults. created(Optional<String> url)ResultResult. 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.ResultResult. fallbackContentType(String fallbackContentType)ResultAuthenticityFilter. filter(FilterChain filterChain, Context context)ResultBasicAuthFilter. filter(FilterChain chain, Context context)ResultFilter. filter(FilterChain filterChain, Context context)Filter the request.ResultSecureFilter. filter(FilterChain chain, Context context)static ResultResults. forbidden()ResultNinja. getBadRequestResult(Context context, BadRequestException exception)Should handle cases where the client sent strange date that led to an error.ResultNinjaDefault. getBadRequestResult(Context context, BadRequestException exception)ResultNinja. 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).ResultNinja. 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).ResultNinjaDefault. getForbiddenResult(Context context)ResultNinjaDefault. getForbiddenResult(Context context, ForbiddenRequestException exception)ResultNinja. 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.ResultNinjaDefault. getInternalServerErrorResult(Context context, Exception exception)Deprecated.ResultNinjaDefault. getInternalServerErrorResult(Context context, Exception exception, Result underlyingResult)ResultNinja. getNotFoundResult(Context context)Should handle cases where no route can be found for a given request.ResultNinja. getNotFoundResult(Context context, RequestNotFoundException exception)Should handle cases where no route can be found for a given request.ResultNinjaDefault. getNotFoundResult(Context context)ResultNinjaDefault. getNotFoundResult(Context context, RequestNotFoundException exception)ResultNinja. getRenderingExceptionResult(Context context, RenderingException exception, Result underlyingResult)Should handle cases where aRenderingExceptionis thrown when handling the rendering of a Result.ResultNinjaDefault. getRenderingExceptionResult(Context context, RenderingException exception, Result underlyingResult)ResultNinja. 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).ResultNinjaDefault. getUnauthorizedResult(Context context)ResultResult. html()Set the content type of this result toTEXT_HTML.static ResultResults. html()static ResultResults. internalServerError()ResultResult. json()Set the content type of this result toAPPLICATION_JSON.static ResultResults. json()ResultResult. jsonp()Set the content type of this result toAPPLICATION_JSONP.static ResultResults. jsonp()ResultResult. jsonView(Class<?> jsonView)Set the Jackson JSON View.ResultFilterChain. next(Context context)Pass the request to the next filterstatic ResultResults. noContent()static ResultResults. notFound()static ResultResults. ok()ResultNinja. onException(Context context, Exception exception)This result should be used when an error occurs.ResultNinjaDefault. onException(Context context, Exception exception)ResultNinjaDefault. onException(Context context, Exception exception, Result underlyingResult)ResultResult. redirect(String url)A redirect that uses 303 see other.static ResultResults. redirect(String url)A redirect that uses 303 see other.ResultReverseRouter.Builder. redirect()Builds the result as aninja.Resultredirect.ResultResult. redirectTemporary(String url)A redirect that uses 307 see other.static ResultResults. redirectTemporary(String url)A redirect that uses 307 see other.ResultResult. render(InputStream input, boolean close)Renders all bytes from the input stream to the output stream.ResultResult. 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.ResultResult. render(String key, Object value)Implicitly generates a hashmap as object being rendered and adds this key, value pair.ResultResult. 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.ResultResult. render(Map<String,Object> mapToRender)Replaces the object being passed by this result to the rendering engine with this map.ResultResult. render(Renderable renderable)Sets this renderable as object to render.ResultResult. renderRaw(byte[] bytes)This method directly renders the byte array to the output.ResultResult. renderRaw(String string)Deprecated.=> use text().render(string), html().render(string), json().render(string), xml().render(string), or contentType(type).render(string).ResultAssetsController. serveStatic()Serves resources from the assets directory of your application.ResultAssetsController. serveWebJars()Serves resources from the assets directory of your application.ResultResult. setContentType(String contentType)Deprecated.ResultResult. status(int statusCode)Set the status of this result.static ResultResults. status(int statusCode)ResultResult. supportedContentType(String contentTypeSupportedByThisResult)Will add a content type to the list of supported content types.ResultResult. supportedContentTypes(String... contentTypesSupportedByThisResult)Will add the content types to the list of supported content types.ResultResult. template(String template)Set the template to render.ResultResult. text()Set the content type of this result toTEXT_PLAIN.static ResultResults. text()static ResultResults. TODO()static ResultResults. unauthorized()ResultResult. unsetCookie(String name)static ResultResults. webSocketContinue()Instructs ninja (and the http container) that it is okay to continue with the websocket handshake.ResultResult. xml()Set the content type of this result toResult#APPLICATON_XML.static ResultResults. xml()Methods in ninja with parameters of type Result Modifier and Type Method Description ResponseStreamsContext. finalizeHeaders(Result result)Finalizing the headers copies all stuff into the headers.ResponseStreamsWrappedContext. finalizeHeaders(Result result)ResponseStreamsContext. finalizeHeadersWithoutFlashAndSessionCookie(Result result)Finalizing the headers copies all stuff into the headers.ResponseStreamsWrappedContext. finalizeHeadersWithoutFlashAndSessionCookie(Result result)ResultNinja. 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.ResultNinjaDefault. getInternalServerErrorResult(Context context, Exception exception, Result underlyingResult)ResultNinja. getRenderingExceptionResult(Context context, RenderingException exception, Result underlyingResult)Should handle cases where aRenderingExceptionis thrown when handling the rendering of a Result.ResultNinjaDefault. getRenderingExceptionResult(Context context, RenderingException exception, Result underlyingResult)ResultNinjaDefault. onException(Context context, Exception exception, Result underlyingResult)voidRenderable. render(Context context, Result result)voidNinja. renderErrorResultAndCatchAndLogExceptions(Result result, Context context)Should be used to render an error.voidNinjaDefault. renderErrorResultAndCatchAndLogExceptions(Result result, Context context)voidContext. returnResultAsync(Result result)Indicate that request processing of an async request is complete.voidWrappedContext. returnResultAsync(Result result)voidRouteBuilder. with(Result result)Deprecated.Use the functional interface methods to supply a new result for each route request.voidRouteBuilderImpl. with(Result result)Deprecated. -
Uses of Result in ninja.diagnostics
Methods in ninja.diagnostics that return Result Modifier and Type Method Description ResultDiagnosticError. getUnderlyingResult()Methods in ninja.diagnostics with parameters of type Result Modifier and Type Method Description static DiagnosticErrorRendererDiagnosticErrorRenderer. build(Context context, Result result, DiagnosticError diagnosticError)static DiagnosticErrorDiagnosticErrorBuilder. build500InternalServerErrorDiagnosticError(Throwable cause, boolean tryToReadLinesFromSourceCode, Result underlyingResult)static DiagnosticErrorDiagnosticErrorBuilder. buildDiagnosticError(String title, Throwable throwable, boolean tryToReadLinesFromSourceCode, Result underlyingResult)static DiagnosticErrorDiagnosticErrorBuilder. buildDiagnosticError(String title, Throwable throwable, String relativeSourcePath, int lineNumberOfError, Result underlyingResult)static DiagnosticErrorDiagnosticErrorBuilder. buildDiagnosticError(String title, Throwable throwable, String packageName, String fileName, int lineNumberOfError, Result underlyingResult)static DiagnosticErrorDiagnosticErrorBuilder. buildDiagnosticError(String title, Throwable throwable, SourceSnippet snippet, int lineNumberOfError, Result underlyingResult)voidDiagnosticError. render(Context context, Result result)voidDiagnosticErrorRenderer. renderResult(Context context, Result result)static voidDiagnosticErrorRenderer. tryToRender(Context context, Result result, DiagnosticError diagnosticError, boolean throwInternalServerExceptionOnError)Constructors in ninja.diagnostics with parameters of type Result Constructor Description DiagnosticError(String title, Throwable throwable, URI sourceLocation, List<String> sourceLines, int lineNumberOfSourceLines, int lineNumberOfError, Result underlyingResult)DiagnosticError(String title, Throwable throwable, Result underlyingResult) -
Uses of Result in ninja.exceptions
Methods in ninja.exceptions that return Result Modifier and Type Method Description ResultRenderingException. getResult()Constructors in ninja.exceptions with parameters of type Result Constructor 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) -
Uses of Result in ninja.i18n
Methods in ninja.i18n that return Result Modifier and Type Method Description ResultLang. setLanguage(String locale, Result result)Force a language in Ninja framwork.ResultLangImpl. setLanguage(String locale, Result result)Methods in ninja.i18n with parameters of type Result Modifier and Type Method Description voidLang. clearLanguage(Result result)Clears the current language.voidLangImpl. clearLanguage(Result result)ResultLang. setLanguage(String locale, Result result)Force a language in Ninja framwork.ResultLangImpl. setLanguage(String locale, Result result)Method parameters in ninja.i18n with type arguments of type Result Modifier and Type Method 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)StringMessages. getWithDefault(String key, String defaultMessage, Context context, Optional<Result> result, Object... params)Gets a message for a message key.StringMessagesImpl. getWithDefault(String key, String defaultMessage, Context context, Optional<Result> result, Object... params) -
Uses of Result in ninja.template
Methods in ninja.template with parameters of type Result Modifier and Type Method Description StringTemplateEngineHelper. getTemplateForResult(Route route, Result result, String suffix)voidTemplateEngine. invoke(Context context, Result result)Render the given object to the given contextvoidTemplateEngineFreemarker. invoke(Context context, Result result)voidTemplateEngineJson. invoke(Context context, Result result)voidTemplateEngineJsonP. invoke(Context context, Result result)voidTemplateEngineText. invoke(Context context, Result result)voidTemplateEngineXml. invoke(Context context, Result result)voidTemplateEngineFreemarker. throwRenderingException(Context context, Result result, Exception cause, String knownTemplateSourcePath)Constructors in ninja.template with parameters of type Result Constructor Description TemplateEngineFreemarkerI18nMethod(Messages messages, Context context, Result result) -
Uses of Result in ninja.utils
Methods in ninja.utils with parameters of type Result Modifier and Type Method Description voidHttpCacheToolkit. addEtag(Context context, Result result, Long lastModified)Adds etag to result.voidHttpCacheToolkitImpl. addEtag(Context context, Result result, Long lastModified)ResponseStreamsAbstractContext. finalizeHeaders(Result result)protected ResponseStreamsAbstractContext. finalizeHeaders(Result result, Boolean handleFlashAndSessionCookie)ResponseStreamsAbstractContext. finalizeHeadersWithoutFlashAndSessionCookie(Result result)voidResultHandler. handleResult(Result result, Context context)
-