protected boolean isAJAXRequest(HttpServletRequest req) {
String requestType = req.getHeader("X-Requested-With");
if (requestType != null && requestType.equals("XMLHttpRequest")) {
return true;
} else {
return false;
}
}