How are you adding the ELResolver programmatically before first request? Using
servlet init? You cant access the facesContext in your Servlet via
ServletContext because myface destroys the first facesContext used by
StartupServletContextListener
(_facesInitializer.destroyStartupFacesContext(facesContext);)
On Thursday, April 30, 2015 5:40 PM, Dora Rajappan
<[email protected]> wrote:
You can add ELResolver via CDI . Just name and scope the bean and use the name
directly in your xhtml. Its not registered with Application interface. So the
sorting caching of the configured EL Resolver is unaffected. When you try to
add ELResolver programmatically before first request happens its not behaving
correctly. And you have suggested two solutions.
On Wednesday, April 29, 2015 10:11 PM, Mike Kienenberger (JIRA)
<[email protected]> wrote:
[
https://issues.apache.org/jira/browse/MYFACES-3984?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14519694#comment-14519694
]
Mike Kienenberger commented on MYFACES-3984:
--------------------------------------------
Can you discuss this issue and the two possible solutions on the
[email protected] mailing list?
Perhaps you could also provide a patch demonstrating which approach you believe
works best.
> Unable to add an ELResolver programmatically when application includes flows
> defined with xml
> ---------------------------------------------------------------------------------------------
>
> Key: MYFACES-3984
> URL: https://issues.apache.org/jira/browse/MYFACES-3984
> Project: MyFaces Core
> Issue Type: Bug
> Affects Versions: 2.2.8
> Reporter: Sami Korhonen
>
> Current implementation of Application interfaces caches CompositeELResolver
> internally. According to Application interface definition ELResolvers may be
> added until application receives first request. This means that, if
> ELResolver is retrieved before first request, Application implementation does
> not behave correctly.
> There are several ways to resolve this issue. One solution is to create a
> lazy initializing ELResolver when Application (Impl) is instantiated. This
> lazy ELResolver should be initialized on first actual call.
> Second possible solution also requires creating ELResolver instance when
> Application is instatiated. In this solution you add new ELResolvers after
> reading configuration files. In order to support MyFaces specific sorting
> feature, you are required to cache and sort entries in another structure
> before registering them to Application's ELResolver.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)