My validator needs to know if it is a full request or an ajax request. In my current solution I check the http request header for the X-Requested-With element:
X-Requested-With
I would not rely on http header. Never tried it by myself, but you could do the following:
PartialViewContext pvc = facesContext.getPartialViewContext(); if(pvc.isAjaxRequest()) { // ... } else { // ... }
Another option is using isPartialRequest() instead of isAjaxRequest()
isPartialRequest()
isAjaxRequest()