use of act.view.RenderAny in project actframework by actframework.
the class RequestHandlerProxy method onResult.
private void onResult(Result result, ActionContext context) {
context.dissolve();
boolean isRenderAny = false;
try {
if (result instanceof RenderAny) {
RenderAny any = (RenderAny) result;
isRenderAny = true;
any.apply(context);
} else {
H.Request req = context.req();
ActResponse<?> resp = context.prepareRespForWrite();
if (result instanceof ErrorResult) {
resp.contentType(req.accept());
}
result.apply(req, resp);
}
} catch (RuntimeException e) {
context.cacheTemplate(null);
throw e;
} finally {
if (isRenderAny) {
RenderAny.clearThreadLocals();
}
}
}
Aggregations