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项目中判断当前请求是否为Ajax请求
最新推荐文章于 2022-03-31 21:23:04 发布