joi, 19 martie 2015

[OmniFaces utilities (2.0)] Check if the current request is an ajax request


[OmniFaces utilities] The isAjaxRequest() method returns whether the current request is an ajax request.

Method:
See also: Faces#getContext()
Usage:

import org.omnifaces.util.Faces;
...
if(Faces.isAjaxRequest()){
   // this is an AJAX requesr
} else {
   // not AJAX request
}

Niciun comentariu:

Trimiteți un comentariu