public static boolean isXHR(HttpServletRequest httpRequest) {
		String requestedWith = httpRequest.getHeader(X_REQUESTED_WITH);
		return requestedWith != null ? requestedWith.equalsIgnoreCase(XML_HTTP_REQUEST) : false;
	}
public static boolean isXHR ( HttpServletRequest httpRequest ) { String requestedWith = httpRequest . getHeader ( X_REQUESTED_WITH ) ; return requestedWith != null ? requestedWith . equalsIgnoreCase ( XML_HTTP_REQUEST ) : false ; }
Test if given HTTP request is performed via XMLHttpRequest.

@param httpRequest HTTP request.
@return true if X-Requested-With header is XMLHttpRequest.