+ request.getCharacterEncoding());
}
}
//
final RequestPath requestPath = inv.getRequestPath();
// save before include
if (requestPath.isIncludeRequest()) {
saveAttributesBeforeInclude(inv);
// 恢复include请求前的各种请求属性(包括Model对象)
rose.addAfterCompletion(new AfterCompletion() {
@Override
public void afterCompletion(Invocation inv, Throwable ex) throws Exception {
restoreRequestAttributesAfterInclude(inv);
}
});
}
// 调用之前设置内置属性
inv.addModel("invocation", inv);
inv.addModel("ctxpath", requestPath.getCtxpath());
// instruction是控制器action方法的返回结果或其对应的Instruction对象(也可能是拦截器、错误处理器返回的)
Object instruction = rose.doNext();
if (Thread.currentThread().isInterrupted()) {
logger.info("stop to render: thread is interrupted");
} else {
// 写flash消息到Cookie (被include的请求不会有功能)
if (!requestPath.isIncludeRequest()) {
FlashImpl flash = (FlashImpl) inv.getFlash(false);
if (flash != null) {
flash.writeNewMessages();
}
}