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

Thomas Andraschko edited comment on MYFACES-4585 at 3/7/23 1:42 PM:
--------------------------------------------------------------------

for me this case should actually work as it looks valid, so i would like to 
leave it open

https://issues.apache.org/jira/browse/MYFACES-3810
it seems only EL caching doesnt work with old handlers, so you might loose a 
bit of the performance gain, when you switch to MF



was (Author: tandraschko):
for me this case should actually work as it looks valid, so i would like to 
leave it open

https://issues.apache.org/jira/browse/MYFACES-3810
it seems only EL caching doesnt work with old handlers, so you might loose a 
bit of the performance gain, we you switch to MF


> EL expression error: MethodNotFoundException due to wrong type
> --------------------------------------------------------------
>
>                 Key: MYFACES-4585
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4585
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 4.0.0
>         Environment: primefaces-test project, jakarta branch
>            Reporter: Manuel K
>            Priority: Major
>         Attachments: image-2023-03-06-13-26-43-151.png
>
>
> When an object is passed through several layers of components, the type 
> somehow gets lost and the expression evaluation uses the wrong type for a 
> method call.
> Taglib component, where converter is of type 
> {_}java.faces.convert.Converter{_}:
> {code:java}
> <?xml version="1.0" encoding="UTF-8"?>
> <ui:composition xmlns="http://www.w3.org/1999/xhtml";
>                 xmlns:ui="http://xmlns.jcp.org/jsf/facelets";
>                 xmlns:p="http://primefaces.org/ui";
>                 xmlns:o="http://omnifaces.org/ui";>
>     <!--@elvariable id="value" type="java.lang.Object"-->
>     <!--@elvariable id="converter" type="java.faces.convert.Converter"-->
>     <!--@elvariable id="readonly" type="java.lang.Boolean"-->
>     <!--@elvariable id="readonlyValue" type="java.lang.String"-->
>     <o:tagAttribute name="value"
>                     default=""/>
>     <o:tagAttribute name="converter"
>                     default=""/>
>     <div>
>         <p:autoComplete id="input"
>                         value="#{value}"
>                         var="item"
>                         converter="#{converter}"
>                         completeMethod="#{converter.suggest}"
>                         itemValue="#{item}"
>                         itemLabel="#{converter.getDisplayValue(item)}">
>             <ui:insert name="autoCompleteChildren"/>
>         </p:autoComplete>
>     </div>
> </ui:composition>
> {code}
> The method call somehow assumes a String, so the following exception is 
> thrown:
> {code:java}
> jakarta.el.MethodNotFoundException: Method not found: class 
> java.lang.String.getDisplayValue(java.lang.String) {code}
> I have created a reproducer here: 
> [https://github.com/mkomko/primefaces-test/tree/expression-error-method-not-found]
> The AutoComplete component should work and render results as follows:
> !image-2023-03-06-13-26-43-151.png!
> It works using 
> {code:java}
> mvn clean jetty:run -Pmojarra40{code}
>  but not using 
> {code:java}
> mvn clean jetty:run -Pmyfaces40{code}
> Thank you very much in advance for taking a look!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to