@Override public boolean isAPI() { if (options.mvc()) return false; return options.contentType() != MediaType.HTML_UTF_8; }
private RouteOptions mvcOpts() { return opts(MediaType.HTML_UTF_8).mvc(true); }
protected String contentTypeInfo(String inside) { String type; if (contentType == MediaType.HTML_UTF_8) { type = options.mvc() ? "mvc" : "html"; } else if (contentType == MediaType.JSON) { type = "json"; } else if (contentType == MediaType.PLAIN_TEXT_UTF_8) { type = "plain"; } else if (contentType == MediaType.BINARY) { type = "binary"; } else { return inside; } return U.frmt("%s(%s)", type, inside); }
"!roles", opts.roles(), "transaction", tx, "mvc", opts.mvc(), "cacheTTL", opts.cacheTTL());
private void execHandlerJob(final Channel channel, final boolean isKeepAlive, final MediaType contentType, final Req req) { With.tag(CTX_TAG_HANDLER).exchange(req).run(() -> { try { req.response() .view(options.view()) .contentType(options.contentType()) .mvc(options.mvc()); handleWithWrappers(channel, isKeepAlive, contentType, req, wrappers.get()); } catch (Throwable e) { handleError(req, e); } }); }
private RouteOptions mvcOpts() { return opts(MediaType.HTML_UTF_8).mvc(true); }
protected String contentTypeInfo(String inside) { String type; if (contentType == MediaType.HTML_UTF_8) { type = options.mvc() ? "mvc" : "html"; } else if (contentType == MediaType.JSON) { type = "json"; } else if (contentType == MediaType.PLAIN_TEXT_UTF_8) { type = "plain"; } else if (contentType == MediaType.BINARY) { type = "binary"; } else { return inside; } return U.frmt("%s(%s)", type, inside); }
@Override public void run() { try { req.response() .view(options.view()) .contentType(options.contentType()) .mvc(options.mvc()); handleWithWrappers(channel, isKeepAlive, contentType, req, wrappers.get()); } catch (Throwable e) { handleError(req, e); } }
"!roles", opts.roles(), "transaction", tx, "mvc", opts.mvc(), "cacheTTL", opts.cacheTTL());