-
Available since OmniFaces 1.6
Collection of utility methods for the Servlet API in general. Most of them are internally used by Faces
and FacesLocal
, however they may also be useful in a "plain vanilla" servlet or servlet filter.
There are as of now also five special methods related to Faces without needing a FacesContext
:
- The
getFacesLifecycle(ServletContext)
which returns the Faces lifecycle, allowing you a.o. to programmatically register Faces application's phase listeners. - The
isFacesAjaxRequest(HttpServletRequest)
which is capable of checking if the current request is a Faces ajax request. - The
isFacesResourceRequest(HttpServletRequest)
which is capable of checking if the current request is a Faces resource request. - The
facesRedirect(HttpServletRequest, HttpServletResponse, String, Object...)
which is capable of distinguishing Faces ajax requests from regular requests and altering the redirect logic on it, exactly like asExternalContext.redirect(String)
does. In other words, this method behaves exactly the same asFaces.redirect(String, Object...)
. - The
isFacesDevelopment(ServletContext)
which is capable of checking if the current Faces application configuration is set to development project stage.
Those methods can be used in for example a servlet filter.
For a full list, check the method summary.
Feature request
If you know more useful methods/functions which you think should be added to this OmniFaces utility class so that everyone can benefit from a "standard" Faces utility library, feel free to post a feature request.
Documentation & Sources