Package org.apache.myfaces.webapp
Class MyFacesContainerInitializer
- java.lang.Object
-
- org.apache.myfaces.webapp.MyFacesContainerInitializer
-
- All Implemented Interfaces:
jakarta.servlet.ServletContainerInitializer
public class MyFacesContainerInitializer extends Object implements jakarta.servlet.ServletContainerInitializer
This class is called by any Java EE 6 complaint container at startup. It checks if the current webapp is a Faces-webapp by checking if some of the Faces related annotations are specified in the webapp classpath or if the faces-config.xml file is present. If so, the listener checks if the FacesServlet has already been defined in web.xml and if not, it adds the FacesServlet with the mappings (/faces/*, *.jsf, *.faces) dynamically.- Version:
- $Revision$ $Date$
- Author:
- Jakob Korherr (latest modification by $Author$)
-
-
Field Summary
Fields Modifier and Type Field Description static String
FACES_SERVLET_ADDED_ATTRIBUTE
If the servlet mapping for the FacesServlet is added dynamically, Boolean.TRUE is stored under this key in the ServletContext.static String
FACES_SERVLET_FOUND
If the servlet mapping for the FacesServlet is found on the ServletContext, Boolean.TRUE is stored under this key in the ServletContext.static String
FACES_SERVLET_SERVLETREGISTRATION
Store the FacesServlet ServletRegistration using this key in the ServletContext.
-
Constructor Summary
Constructors Constructor Description MyFacesContainerInitializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onStartup(Set<Class<?>> clazzes, jakarta.servlet.ServletContext servletContext)
-
-
-
Field Detail
-
FACES_SERVLET_ADDED_ATTRIBUTE
public static final String FACES_SERVLET_ADDED_ATTRIBUTE
If the servlet mapping for the FacesServlet is added dynamically, Boolean.TRUE is stored under this key in the ServletContext.- See Also:
- Constant Field Values
-
FACES_SERVLET_FOUND
public static final String FACES_SERVLET_FOUND
If the servlet mapping for the FacesServlet is found on the ServletContext, Boolean.TRUE is stored under this key in the ServletContext.- See Also:
- Constant Field Values
-
FACES_SERVLET_SERVLETREGISTRATION
public static final String FACES_SERVLET_SERVLETREGISTRATION
Store the FacesServlet ServletRegistration using this key in the ServletContext. The is necessary for the Faces 4.0 Extensionless Mapping feature. This is used in FacesInitializerImpl when configuring the Extensionless Mapping feature since an UnsupportedOperationException is thrown when calling the ServletContext.getServletRegistrations method if the StartupServletContextListener was added programmatically.- See Also:
- Constant Field Values
-
-