如何判断一个请求是不是ajax请求

public boolean isAjaxRequest(HttpServletRequest request){
		String header = request.getHeader("X-Requested-With");
		boolean isAjax = "XMLHttpRequest".equals(header) ? true:false;
		return isAjax;
	}

  

原文地址:https://www.cnblogs.com/Jeely/p/10951301.html