@Override public boolean committed() { return rsp.committed(); }
@Override public void handle(Request req, Response rsp, Route.Chain chain) throws Throwable { Object result = invoke(req, rsp, chain); if (!rsp.committed()) { Class<?> returnType = handler.getReturnType(); if (returnType == void.class) { rsp.status(Status.NO_CONTENT); } else { rsp.status(Status.OK); rsp.send(result); } } chain.next(req, rsp); }
public void handle(final Client<?, ?> client, final HttpAction action) { if (!rsp.committed()) { int statusCode = action.getCode(); // on error, let jooby handle it if (statusCode >= 400) { if (client instanceof IndirectBasicAuthClient) { rsp.status(statusCode).end(); } else { throw new Err(statusCode, action); } } } } }
@Override public void next(final String prefix, final Request req, final Response rsp) throws Throwable { if (rsp.committed()) { return; } if (prefix != null) { this.prefix = prefix; } Route route = next(this.prefix); // set route rreq.route(hasAttrs ? attrs(route, routes, i - 1) : route); rrsp.route(route); get(route).handle(req, rsp, this); }
@Override public boolean committed() { return rsp.committed(); }
@Override public void handle(Request req, Response rsp, Route.Chain chain) throws Throwable { Object result = invoke(req, rsp, chain); if (!rsp.committed()) { Class<?> returnType = handler.getReturnType(); if (returnType == void.class) { rsp.status(Status.NO_CONTENT); } else { rsp.status(Status.OK); rsp.send(result); } } chain.next(req, rsp); }
public void handle(final Client<?, ?> client, final HttpAction action) { if (!rsp.committed()) { int statusCode = action.getCode(); // on error, let jooby handle it if (statusCode >= 400) { if (client instanceof IndirectBasicAuthClient) { rsp.status(statusCode).end(); } else { throw new Err(statusCode, action); } } } } }
@Override public void next(final String prefix, final Request req, final Response rsp) throws Throwable { if (rsp.committed()) { return; } if (prefix != null) { this.prefix = prefix; } Route route = next(this.prefix); // set route rreq.route(hasAttrs ? attrs(route, routes, i - 1) : route); rrsp.route(route); get(route).handle(req, rsp, this); }