June 2014
Intermediate to advanced
578 pages
12h 2m
English
JSF can answer this question by inspecting request headers or checking the PartialViewContext.isAjaxRequest method. The request headers that provide information about the request type are Faces-Request and X-Requested-With. For an AJAX request, the Faces-Request header will have the value partial/ajax, while the X-Requested-With request type will have the value XMLHttpRequest (in JSF 2.2, X-Requested-With doesn't seem to work; however, for the sake of completeness, you can test them again). In the following screenshot, you can see the headers of a typical JSF 2.2 AJAX request:

In a managed bean, you can determine the type ...
Read now
Unlock full access