判断客户端的请求是Ajax请求的方法

String requestType = request.getHeader("X-Requested-With");

if (requestType != null && requestType.equalsIgnoreCase("XMLHttpRequest")) {

          //是XMLHttpRequest则为Ajax请求

}

谷歌浏览器:


火狐浏览器:

猜你喜欢

转载自blog.csdn.net/jingshenbusi/article/details/78499511
今日推荐