[
https://issues.apache.org/jira/browse/MYFACES-4589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17698268#comment-17698268
]
Thomas Andraschko commented on MYFACES-4589:
--------------------------------------------
Leo could propably find it in short time (he is not active anymore since years)
but i think noone of us has the knowledge currently to find it in a short time.
the question is, who caches the "color" (and why) isntead of asking the
ELResolvers? Why does it work on Mojarra? We cache many stuff in MyFaces, maybe
thats the reason.
So you would need to debug all ValueExpression creations and evaluations. And
even you find the reason, there may not be a easy way to fix it. (remember, we
have ~1500 unit tests and pass the TCK, so the case is quite special and
propably never occured in the past).
TBH i think this would cost me a min of 8 hours. If you are interessted in
sponsoring this via your company, feel free to ping me. Otherwise i would be
much happier if you debug yourself and provide a fix :)
I think choosing a different bean name is the only workaround for now.
> PropertyNotFoundException in nested components if attribute has same name as
> bean
> ---------------------------------------------------------------------------------
>
> Key: MYFACES-4589
> URL: https://issues.apache.org/jira/browse/MYFACES-4589
> Project: MyFaces Core
> Issue Type: Bug
> Components: General
> Affects Versions: 4.0.0, 4.0.1
> Environment: primefaces-test project, jakarta branch
> Reporter: Manuel K
> Priority: Major
>
> I apologize in advance if this one is a SOB to debug and hopefully fix. Maybe
> not though?
> Given the following nested component structure:
> panel (composite component) -> panel (taglib component) -> departmentInfo
> (composite component) -> outputIconText (composite component) -> icon (taglib
> component)
> The panel composite component and the panel taglib component have an
> attribute called "color". The departmentInfo component uses "color" in an EL
> expression, which is supposed to be a call to a named bean "Color":
> {code:java}
> <?xml version="1.0" encoding="UTF-8"?>
> <ui:component xmlns="http://www.w3.org/1999/xhtml"
> xmlns:cc="http://xmlns.jcp.org/jsf/composite"
> xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
> xmlns:test="http://xmlns.jcp.org/jsf/composite/components">
> <cc:interface>
> <cc:attribute name="value"
> required="true"
> type="org.primefaces.test.Department"/>
> </cc:interface>
> <cc:implementation>
> <div id="#{cc.clientId}">
> <test:outputIconText icon="#{icon.test} #{color.blue}"
> value="#{cc.attrs.value.name}"/>
> </div>
> </cc:implementation>
> </ui:component> {code}
> Somehow it seems to be interpreted as the attribute though, because the
> following exception occurs:
> {code:java}
> Caused by: jakarta.el.PropertyNotFoundException: Property [blue] not found on
> type [java.lang.String]
> at jakarta.el.BeanELResolver$BeanProperties.get (BeanELResolver.java:251)
> {code}
> The exception occurs only using MyFaces ({_}mvn clean jetty:run
> -Pmyfaces40{_}) but works using Mojarra ({_}mvn clean jetty:run
> -Pmojarra40{_}). You can find my reproducer here:
> [https://github.com/mkomko/primefaces-test/tree/expression-error-property-not-found]
> Of course, _org.apache.myfaces.STRICT_JSF_2_FACELETS_COMPATIBILITY_ is set to
> _true_ but it does not matter in this case.
> Thank you very much in advance!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)