Class FacesInitializer

  • All Implemented Interfaces:
    jakarta.servlet.ServletContainerInitializer

    public class FacesInitializer
    extends Object
    implements jakarta.servlet.ServletContainerInitializer
    Initializes Jakarta Faces if at least one of the following conditions is met:
    • The Set of classes passed to this initializer contains an user-defined Faces type, or
    • FacesServlet has been explicitly mapped ,or
    • /WEB-INF/faces-config.xml exists
    If it is met, and the FacesServlet has not been explicitly mapped, then add mappings *.xhtml, /faces, *.jsf, and *.faces for the FacesServlet.
    • Constructor Detail

      • FacesInitializer

        public FacesInitializer()
    • Method Detail

      • onStartup

        public void onStartup​(Set<Class<?>> classes,
                              jakarta.servlet.ServletContext servletContext)
                       throws jakarta.servlet.ServletException
        Specified by:
        onStartup in interface jakarta.servlet.ServletContainerInitializer
        Throws:
        jakarta.servlet.ServletException
      • addAnnotatedClasses

        public static void addAnnotatedClasses​(Set<Class<?>> classes,
                                               jakarta.servlet.ServletContext servletContext)