[
https://issues.apache.org/jira/browse/MYFACES-2875?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12898855#action_12898855
]
Jakob Korherr commented on MYFACES-2875:
----------------------------------------
I know it looks suspiciously, but it works this way:
When the page containing the composite component is processed, every attribute
of the composite component is handled as a ValueExpression (this is what you
saw at 1)). Afterwards at retargetMethodExpressions() the real
MethodExpressions are created out of the previous ValueExpressions' expression
strings (this is what you saw at 2)).
This has to happen this way, because retargetMethodExpressions() needs some
metadata which isn't available when the page containing the composite component
is processed. However we do need the expression strings, thus the temporary
ValueExpressions are created.
Maybe this could be done in a better way, but I did not dig into it this much
and I don't know what the spec says about this.
> FaceletVLD.retargetMethodExpressions should preserve EL VariableMapper and
> FunctionMapper
> -----------------------------------------------------------------------------------------
>
> Key: MYFACES-2875
> URL: https://issues.apache.org/jira/browse/MYFACES-2875
> Project: MyFaces Core
> Issue Type: Bug
> Components: JSR-252
> Affects Versions: 2.0.2-SNAPSHOT
> Environment: myfaces current trunk
> Reporter: Martin Kočí
> Assignee: Jakob Korherr
> Fix For: 2.0.2-SNAPSHOT
>
> Attachments: MYFACES-2875.patch
>
>
> org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.retargetMethodExpressions
> calls facesContext.getELContext() but should use FaceletContext instead to
> preserve EL variable and function mapping. Consider this example:
> <ui:param
> name="localBean"
> value="#{very.long.path.to.a.bean.in.el}" />
> <a:niceCompositeComponent customMethod="#{localBean.method}" >
> will not work but
> customMethod="#{very.long.path.to.a.bean.in.el.method} will.
> This can be easily fixed by using ELContext elContext = (ELContext)
> context.getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY);
> instead of facesContext.getELContext().
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.