Top Description Fields Constructors Methods
com.sun.faces.config

public Class FacesInitializer

extends Object
implements ServletContainerInitializer
Class Inheritance
All Implemented Interfaces
jakarta.servlet.ServletContainerInitializer
Annotations
@HandlesTypes:ClientWindowScoped, Converter, DataModel, FacesBehavior, FacesBehaviorRenderer, FacesComponent, FacesConfig, FacesConverter, FacesDataModel, FacesRenderer, FacesValidator, FlowBuilderParameter, FlowDefinition, FlowScoped, ListenerFor, ListenersFor, NamedEvent, PhaseListener, Push, Renderer, ResourceDependencies, ResourceDependency, UIComponent, Validator, ViewScoped
Static Imports
com.sun.faces.RIConstants.ANNOTATED_CLASSES, .RIConstants.FACES_SERVLET_MAPPINGS, .RIConstants.FACES_SERVLET_REGISTRATION, com.sun.faces.util.Util.isEmpty, java.lang.Boolean.parseBoolean, java.util.logging.Level.WARNING

Initializes Jakarta Faces if at least one of the following conditions is met: If it is met, and the FacesServlet has not been explicitly mapped, then add mappings *.xhtml, /faces, *.jsf, and *.faces for the FacesServlet.

Field Summary

Modifier and TypeField and Description
private static final String
public static final String
private static final String
private static final String[]
private static final String[]
private static final Logger
public static final String
public static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
addAnnotatedClasses(Set<Class<?>> classes, ServletContext servletContext)

private static ServletRegistration
private static void
private static void
private static void
private static boolean
private static boolean
public void
onStartup(Set<Class<?>>
the Set of application classes that extend, implement, or have been annotated with the class types specified by the HandlesTypes annotation, or null if there are no matches, or this ServletContainerInitializer has not been annotated with HandlesTypes
classes
,
ServletContext
the ServletContext of the web application that is being started and in which the classes contained in c were found
servletContext
)

Implements jakarta.servlet.ServletContainerInitializer.onStartup.

Notifies this ServletContainerInitializer of the startup of the application represented by the given ServletContext.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

FACES_CONFIG_RESOURCE_PATHback to summary
private static final String FACES_CONFIG_RESOURCE_PATH
FACES_PACKAGE_PREFIXback to summary
public static final String FACES_PACKAGE_PREFIX
FACES_SERVLET_CLASS_NAMEback to summary
private static final String FACES_SERVLET_CLASS_NAME
FACES_SERVLET_MAPPINGS_WITH_XHTMLback to summary
private static final String[] FACES_SERVLET_MAPPINGS_WITH_XHTML
FACES_SERVLET_MAPPINGS_WITHOUT_XHTMLback to summary
private static final String[] FACES_SERVLET_MAPPINGS_WITHOUT_XHTML
LOGGERback to summary
private static final Logger LOGGER
MOJARRA_PACKAGE_PREFIXback to summary
public static final String MOJARRA_PACKAGE_PREFIX
MOJARRA_TEST_PACKAGE_PREFIXback to summary
public static final String MOJARRA_TEST_PACKAGE_PREFIX

Constructor Detail

FacesInitializerback to summary
public FacesInitializer()

Method Detail

addAnnotatedClassesback to summary
public static void addAnnotatedClasses(Set<Class<?>> classes, ServletContext servletContext)
getExistingFacesServletRegistrationback to summary
private static ServletRegistration getExistingFacesServletRegistration(ServletContext servletContext)
handleCdiConcernsback to summary
private static void handleCdiConcerns(ServletContext context) throws ServletException
handleMappingConcernsback to summary
private static void handleMappingConcerns(ServletContext servletContext) throws ServletException
handleWebSocketConcernsback to summary
private static void handleWebSocketConcerns(ServletContext context) throws ServletException
isFacesConfigFilePresentback to summary
private static boolean isFacesConfigFilePresent(ServletContext context)
isFacesServletRegistrationPresentback to summary
private static boolean isFacesServletRegistrationPresent(ServletContext context)
onStartupback to summary
public void onStartup(Set<Class<?>> classes, ServletContext servletContext) throws ServletException

Implements jakarta.servlet.ServletContainerInitializer.onStartup.

Doc from jakarta.servlet.ServletContainerInitializer.onStartup.

Notifies this ServletContainerInitializer of the startup of the application represented by the given ServletContext.

If this ServletContainerInitializer is bundled in a JAR file inside the WEB-INF/lib directory of an application, its onStartup method will be invoked only once during the startup of the bundling application. If this ServletContainerInitializer is bundled inside a JAR file outside of any WEB-INF/lib directory, but still discoverable as described above, its onStartup method will be invoked every time an application is started.

Parameters
classes:Set<Class<?>>

the Set of application classes that extend, implement, or have been annotated with the class types specified by the HandlesTypes annotation, or null if there are no matches, or this ServletContainerInitializer has not been annotated with HandlesTypes

servletContext:ServletContext

the ServletContext of the web application that is being started and in which the classes contained in c were found

Annotations
@Override
Exceptions
ServletException:
if an error has occurred