您的位置:首页 > 其它

WEB项目中判断当前请求是否为Ajax请求

2016-08-16 10:09 225 查看
import javax.servlet.http.HttpServletRequest;

public class AjaxUtil {
public static boolean isAjax(HttpServletRequest request) {
String param = request.getHeader("X-Requested-With");
if ("XMLHttpRequest".equals(param))
return true;
else
return false;
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  web