Package | Description |
---|---|
io.jooby |
Modifier and Type | Method and Description |
---|---|
default Context |
Context.attribute(String key,
Object value)
Set an application attribute.
|
Context |
Context.detach(Runnable action)
Tells context that response will be generated form a different thread.
|
Context |
Context.dispatch(Executor executor,
Runnable action)
Dispatch context to the given executor.
|
Context |
Context.dispatch(Runnable action)
Dispatch context to a worker threads.
|
default Context |
Context.flash(String name,
String value)
Set a flash attribute.
|
Context |
Context.removeResponseHeader(String name)
Remove a response header.
|
default Context |
Context.render(Object value)
Render a value and send the response to client.
|
default Context |
Context.responseStream(MediaType contentType,
Sneaky.Consumer<OutputStream> consumer)
HTTP response channel as output stream.
|
default Context |
Context.responseStream(Sneaky.Consumer<OutputStream> consumer)
HTTP response channel as output stream.
|
default Context |
Context.responseWriter(MediaType contentType,
Charset charset,
Sneaky.Consumer<PrintWriter> consumer)
HTTP response channel as response writer.
|
default Context |
Context.responseWriter(MediaType contentType,
Sneaky.Consumer<PrintWriter> consumer)
HTTP response channel as response writer.
|
default Context |
Context.responseWriter(Sneaky.Consumer<PrintWriter> consumer)
HTTP response channel as response writer.
|
default Context |
Context.send(AttachedFile file)
Send a file attached response.
|
Context |
Context.send(byte[] data)
Send response data.
|
default Context |
Context.send(io.netty.buffer.ByteBuf data)
Send response data.
|
Context |
Context.send(ByteBuffer data)
Send response data.
|
Context |
Context.send(FileChannel file)
Send a file response.
|
Context |
Context.send(InputStream input)
Send response data.
|
default Context |
Context.send(Path file)
Send a file response.
|
Context |
Context.send(ReadableByteChannel channel)
Send response data.
|
Context |
Context.send(StatusCode statusCode)
Send an empty response with the given status code.
|
default Context |
Context.send(String data)
Send response data.
|
Context |
Context.send(String data,
Charset charset)
Send response data.
|
default Context |
Context.sendError(Throwable cause)
Send an error response.
|
default Context |
Context.sendError(Throwable cause,
StatusCode statusCode)
Send an error response.
|
default Context |
Context.sendRedirect(StatusCode redirect,
String location)
Send a redirect response.
|
default Context |
Context.sendRedirect(String location)
Send a
302 response. |
Context |
Context.setDefaultResponseType(MediaType contentType)
Set the default response content type header.
|
Context |
Context.setPathMap(Map<String,String> pathMap)
Set path map.
|
Context |
Context.setResponseCode(int statusCode)
Set response status code.
|
default Context |
Context.setResponseCode(StatusCode statusCode)
Set response status code.
|
Context |
Context.setResponseCookie(Cookie cookie)
Set/add a cookie to response.
|
default Context |
Context.setResponseHeader(String name,
Date value)
Set response header.
|
default Context |
Context.setResponseHeader(String name,
Instant value)
Set response header.
|
default Context |
Context.setResponseHeader(String name,
Object value)
Set response header.
|
Context |
Context.setResponseHeader(String name,
String value)
Set response header.
|
Context |
Context.setResponseLength(long length)
Set response content length header.
|
default Context |
Context.setResponseType(MediaType contentType)
Set response content type header.
|
Context |
Context.setResponseType(MediaType contentType,
Charset charset)
Set response content type header.
|
Context |
Context.setResponseType(String contentType)
Set response content type header.
|
Context |
Context.setRoute(Route route)
Set matching route.
|
Modifier and Type | Method and Description |
---|---|
Object |
AssetHandler.apply(Context ctx) |
ByteRange |
ByteRange.apply(Context ctx)
For partial request this method set the following byte range response headers:
- Accept-Ranges
- Content-Range
- Content-Length
For not satisfiable requests:
- Throws a
StatusCode.REQUESTED_RANGE_NOT_SATISFIABLE
Otherwise this method does nothing. |
void |
Route.Before.apply(Context ctx)
Execute application code before next handler.
|
Object |
Route.Handler.apply(Context ctx)
Execute application code.
|
String |
TemplateEngine.apply(Context ctx,
ModelAndView modelAndView)
Render a model and view instance as String.
|
void |
Route.After.apply(Context ctx,
Object result)
Execute application logic on a route response.
|
void |
ErrorHandler.apply(Context ctx,
Throwable cause,
StatusCode statusCode)
Produces an error response using the given exception and status code.
|
static FlashMap |
FlashMap.create(Context ctx,
Cookie template)
Creates a new flash-scope using the given cookie.
|
static Session |
Session.create(Context context,
Session session)
Creates a new session and attach it to current request.
|
void |
SessionId.deleteSessionId(Context ctx,
String sessionId) |
void |
Router.Match.execute(Context context) |
String |
SessionId.findSessionId(Context ctx) |
Router.Match |
Router.match(Context ctx)
Find a matching route using the given context.
|
Router.Match |
Jooby.match(Context ctx) |
void |
Sender.Callback.onComplete(Context ctx,
Throwable cause)
Callback after for
write operation. |
<T> T |
Parser.parse(Context ctx,
Type type)
Parse HTTP body into the given type.
|
byte[] |
Renderer.render(Context ctx,
Object value)
Renderer a value into a byte array or
null if given object isn't supported it. |
default byte[] |
TemplateEngine.render(Context ctx,
Object value) |
void |
SessionId.saveSessionId(Context ctx,
String sessionId) |
Modifier and Type | Method and Description |
---|---|
Router |
Router.use(Predicate<Context> predicate,
Router router)
Import routes from given router.
|
Jooby |
Jooby.use(Predicate<Context> predicate,
Router router) |
Copyright © 2019. All rights reserved.