myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Kočí (JIRA) <...@myfaces.apache.org>
Subject [jira] Commented: (MYFACES-2875) FaceletVLD.retargetMethodExpressions should preserve EL VariableMapper and FunctionMapper
Date Thu, 12 Aug 2010 20:50:17 GMT

    [ https://issues.apache.org/jira/browse/MYFACES-2875?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12897941#action_12897941
] 

Martin Kočí commented on MYFACES-2875:
--------------------------------------

During debugging I noticed that the same EL expression ("#{localBean.method}" from example)
is created twice:

1)
ExpressionBuilder.<init>(String, ELContext) line: 112
ExpressionFactoryImpl.createValueExpression(ELContext, String, Class) line: 91	
WrappedExpressionFactory.createValueExpression(ELContext, String, Class<?>) line: 59

TagAttributeImpl.getValueExpression(FaceletContext, Class) line: 339	
RetargetMethodExpressionRule$RetargetValueExpressionMapper.applyMetadata(FaceletContext, Object)
line: 53	
MetadataImpl.applyMetadata(FaceletContext, Object) line: 45	
CompositeComponentResourceTagHandler.setAttributes(FaceletContext, Object) line: 346	
ComponentTagHandlerDelegate.apply(FaceletContext, UIComponent) line: 208	

2)
ExpressionBuilder.<init>(String, ELContext) line: 112	
ExpressionFactoryImpl.createMethodExpression(ELContext, String, Class, Class[]) line: 80	
WrappedExpressionFactory.createMethodExpression(ELContext, String, Class<?>, Class<?>[])
line: 45	
FaceletViewDeclarationLanguage.retargetMethodExpressions(FacesContext, UIComponent) line:
920	
CompositeComponentResourceTagHandler.applyNextHandler(FaceletContext, UIComponent) line: 176

ComponentTagHandlerDelegate.apply(FaceletContext, UIComponent) line: 263	

The first one looks suspiciously - is it ok? Especially RetargetValueExpressionMapper - 'Value'
vs.  'Method'.


> 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čí
>         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.


Mime
View raw message