myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leonardo Uribe (JIRA)" <...@myfaces.apache.org>
Subject [jira] [Created] (MYFACES-3955) [perf] improve #{cc.attrs...} resolution, handling the map with a custom ELResolver
Date Wed, 04 Feb 2015 20:34:34 GMT
Leonardo Uribe created MYFACES-3955:
---------------------------------------

             Summary: [perf] improve #{cc.attrs...} resolution, handling the map with a custom
ELResolver
                 Key: MYFACES-3955
                 URL: https://issues.apache.org/jira/browse/MYFACES-3955
             Project: MyFaces Core
          Issue Type: Improvement
          Components: JSR-344
            Reporter: Leonardo Uribe
            Assignee: Leonardo Uribe
            Priority: Minor


Section 5.6.2.2. there is a part when you need to return a Map, and that map is resolved by
MapELResolver, but that is not a good idea, because this resolver is the last of the EL Resolver
chain. It is also necessary to call FacesContext.getCurrentInstance() internally to evaluate
the target EL expressions. It would be better if this is still a map, but we force that another
EL Resolver (it could be the same) handles this object (using a class cast that check if the
object implements some interface). In that way, we can pass the FacesContext  instance to
a custom method that receives FacesContext as parameter, instead use Map.get().

That simple change would increase performance of composite components, improving the speed
of the EL evaluation.

The point is the spec says that a map should be returned, but it doesn't say anything about
that MapELResolver should resolve the map. So, the change proposed is add a custom ELResolver
to handle #{cc.attrs...} map in the same way as MapELResolver, but make some shorcuts, like
pass the FacesContext, and so on, improving composite components performance. 

We can use a flag to enable/disable this behavior, but let it as default enabled. Please note
technically we are not breaking the spec, because it is not expected that MapELResolver or
any other resolver handles #{cc.attrs...} map




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message