Class PrimeFacesResourceProcessor

  • All Implemented Interfaces:
    java.io.Serializable, java.util.EventListener, javax.faces.event.PhaseListener

    public class PrimeFacesResourceProcessor
    extends java.lang.Object
    implements javax.faces.event.PhaseListener
    Creates a custom PhaseListener for RENDER_RESPONSE phase which will during beforePhase() dynamically add those PrimeFaces resources via UIViewRoot#addComponentResource(). This will run far before those @ResourceDependency annotations are processed. This satisfies PrimeFaces' intent of having those hardcoded resources to be rendered before of the dependencies of their components.

    Register it as below in faces-config.xml:

       <lifecycle>
          <phase-listener>org.primefaces.extensions.application.PrimeFacesResourceProcessor</phase-listener>
       </lifecycle>
     
    Since:
    10.0.0
    See Also:
    OmniFaces, Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void afterPhase​(javax.faces.event.PhaseEvent event)  
      void beforePhase​(javax.faces.event.PhaseEvent event)  
      protected void encodeValidationResources​(javax.faces.context.FacesContext context, boolean beanValidationEnabled)  
      javax.faces.event.PhaseId getPhaseId()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PrimeFacesResourceProcessor

        public PrimeFacesResourceProcessor()
    • Method Detail

      • getPhaseId

        public javax.faces.event.PhaseId getPhaseId()
        Specified by:
        getPhaseId in interface javax.faces.event.PhaseListener
      • afterPhase

        public void afterPhase​(javax.faces.event.PhaseEvent event)
        Specified by:
        afterPhase in interface javax.faces.event.PhaseListener
      • beforePhase

        public void beforePhase​(javax.faces.event.PhaseEvent event)
        Specified by:
        beforePhase in interface javax.faces.event.PhaseListener
      • encodeValidationResources

        protected void encodeValidationResources​(javax.faces.context.FacesContext context,
                                                 boolean beanValidationEnabled)