判断是否是ajax请求

private boolean isAjaxRequest(HttpServletRequest request) {  
        String header = request.getHeader("X-Requested-With");  
        if (header != null && "XMLHttpRequest".equals(header))  
            return true;  
        else 
            return false;  
    }

你可能感兴趣的:(Ajax)