判断是否是Ajax请求

private boolean isAjaxRequest(HttpServletRequest request,HttpServletResponse response){
		if(request.getHeader("x-requested-with") != null 
				&&request.getHeader("x-requested-with").equalsIgnoreCase("XMLHttpRequest")){
			return true;
		}else{
			return false;
		}
	}

 

你可能感兴趣的:(ajax请求)