日期:2014-05-16  浏览次数:20648 次

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