判断是否是Ajax请求
/** * 判断是否是Ajax请求 * * @param request * @return */ private boolean isAjax(HttpServletRequest request) { if (request.getHeader("x-requested-with") != null && request.getHeader("x-requested-with").equalsIgnoreCase("XMLHttpRequest")) { return true; } return false; }