本文整理匯總了Java中org.springframework.web.servlet.HandlerInterceptor.afterCompletion方法的典型用法代碼示例。如果您正苦於以下問題:Java HandlerInterceptor.afterCompletion方法的具體用法?Java HandlerInterceptor.afterCompletion怎麽用?Java HandlerInterceptor.afterCompletion使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.web.servlet.HandlerInterceptor
的用法示例。
在下文中一共展示了HandlerInterceptor.afterCompletion方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: afterCompletion
import org.springframework.web.servlet.HandlerInterceptor; //導入方法依賴的package包/類
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
List<? extends HandlerInterceptor> interceptors = getInterceptors(request, handler);
if (!CollectionUtils.isEmpty(interceptors)) {
for (HandlerInterceptor interceptor : interceptors) {
interceptor.afterCompletion(request, response, handler, ex);
}
}
}
示例2: afterCompletion
import org.springframework.web.servlet.HandlerInterceptor; //導入方法依賴的package包/類
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
for (int i = handlers.size() - 1; i >= 0; i--) {
HandlerInterceptor item = handlers.get(i);
try {
item.afterCompletion(request, response, handler, ex);
} catch (Exception e) {
log.error("", e);
}
}
}
示例3: applyCompleteHandlers
import org.springframework.web.servlet.HandlerInterceptor; //導入方法依賴的package包/類
public static void applyCompleteHandlers(HttpServletRequest req, HttpServletResponse res) {
for (HandlerInterceptor in : getInterceptors().reverse()) {
try {
in.afterCompletion(req, res, null, null);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}