java.lang.Object
org.omnifaces.util.Platform
This class provides access to Jakarta platform services from the view point of Faces.
Note that this utility class can only be used in a Faces environment and is thus not a Jakarta general way to obtain platform services.
For a full list of utility methods, check the method summary.
- Since:
- 1.6
- Author:
- Arjan Tijms
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetDefaultFacesServletMapping(ServletContext servletContext) Determines and returns the default faces servlet mapping.static Collection<String>getFacesServletMappings(ServletContext servletContext) Returns the mappings associated with theFacesServlet.static ServletRegistrationgetFacesServletRegistration(ServletContext servletContext) Returns theServletRegistrationassociated with theFacesServlet.
-
Method Details
-
getFacesServletRegistration
Returns theServletRegistrationassociated with theFacesServlet.- Parameters:
servletContext- The context to get the ServletRegistration from.- Returns:
- ServletRegistration for FacesServlet, or
nullif the FacesServlet is not installed. - Since:
- 1.8
-
getFacesServletMappings
Returns the mappings associated with theFacesServlet.- Parameters:
servletContext- The context to get theFacesServletfrom.- Returns:
- The mappings associated with the
FacesServlet, or an empty set. - Since:
- 2.5
-
getDefaultFacesServletMapping
Determines and returns the default faces servlet mapping. This will loop overgetFacesServletMappings(ServletContext)and pick the first one starting with*.or ending with/*. If Faces is prefix mapped (e.g./faces/*), then this returns the whole path, with a leading slash (e.g./faces). If Faces is suffix mapped (e.g.*.xhtml), then this returns the whole extension (e.g..xhtml). If none is found, then this falls back to.xhtml. This is for the first time determined inApplicationInitializerand cached in theServletContext.- Returns:
- The default faces servlet mapping (without the wildcard).
- Since:
- 3.10
-