private void configureResolverForJSP ( JspApplicationContext appCtx , RuntimeConfig runtimeConfig ) { FacesCompositeELResolver facesCompositeELResolver = new FacesCompositeELResolver ( Scope . JSP ) ; appCtx . addELResolver ( facesCompositeELResolver ) ; PhaseListener resolverForJSPInitializer = new ResolverForJSPInitializer ( createResolverBuilderForJSP ( runtimeConfig ) , facesCompositeELResolver ) ; LifecycleFactory factory = ( LifecycleFactory ) FactoryFinder . getFactory ( FactoryFinder . LIFECYCLE_FACTORY ) ; for ( Iterator < String > iter = factory . getLifecycleIds ( ) ; iter . hasNext ( ) ; ) { factory . getLifecycle ( iter . next ( ) ) . addPhaseListener ( resolverForJSPInitializer ) ; } }
Register a phase listener to every lifecycle . This listener will lazy fill the el resolver for jsp as soon as the first lifecycle is executed . This is necessarry to allow a faces application further setup after MyFaces has been initialized . When the first request is processed no further configuation of the el resolvers is allowed .