Package org.omnifaces

Class ApplicationListener

All Implemented Interfaces:
ServletContextListener, EventListener

@WebListener public class ApplicationListener extends DefaultServletContextListener

OmniFaces application listener. This runs when the servlet context is created. This performs the following tasks:

  1. Check if Faces 3.0 is available, otherwise log and fail.
  2. Check if CDI 3.0 is available, otherwise log and fail.
  3. Load Cache provider and register its filter if necessary.
  4. Add FacesViews mappings to FacesServlet if necessary.
  5. Add ViewResourceHandler mapping to FacesServlet if necessary.
  6. Register FacesExceptionFilter via FullAjaxExceptionHandler if necessary.
  7. Instantiate Eager application scoped beans and register EagerBeansWebListener if necessary.
  8. Register GraphicImageBean beans in GraphicResource.
  9. Register Socket endpoint if necessary.

This is invoked after ApplicationInitializer and before ApplicationProcessor. If any exception is thrown, then the deployment will fail, unless the "org.omnifaces.SKIP_DEPLOYMENT_EXCEPTION" context parameter is set to true, it will then merely log a WARNING line.

Since:
2.0
Author:
Bauke Scholtz