判断是否为ajax请求
if (request.getHeader("x-requested-with") != null && request.getHeader("x-requested-with").equalsIgnoreCase("XMLHttpRequest")) { out.print("该请求是 AJAX 异步HTTP请求。"); }else{ out.print("该请求是传统的 同步HTTP请求。"); }
本文来自博客园,作者:咔咔皮卡丘,转载请注明原文链接:https://www.cnblogs.com/anquing/p/17638449.html