5

With primefaces 5.1 it was no problem to refer only a getter in a managed bean like

<ui:param name="curSearch" value="#{searchBL.getSelectedSearch()}" />

Changed to primefaces 5.2.2 I have to do

<ui:param name="curSearch" value="#{searchBL.selectedSearch}" />

and provide a getter and a setter. Why?

Exception:

09:35:29,178 SEVERE [javax.enterprise.resource.webcontainer.jsf.application] (http-/0.0.0.0:9090-6) Error Rendering View[/views/main.xhtml]: javax.el.ELException: /sections/search/searchOptions.xhtml @23,111 value="#{curSearch.sortPropertyName}": /sections/search/firstSearchTab.xhtml @44,53 value="#{curSearch}": /sections/searchMaskContent.xhtml @38,74 value="#{searchBL.getSelectedSearch()}": Cannot find method 'getSelectedSearch' in 'class SearchBL$Proxy$_$$_WeldClientProxy'
at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:103) [jsf-impl-2.2.10.jar:2.2.10]
at org.primefaces.el.ValueExpressionAnalyzer.intercept(ValueExpressionAnalyzer.java:69) [primefaces-5.2.2.jar:5.2.2]
at org.primefaces.el.ValueExpressionAnalyzer.getReference(ValueExpressionAnalyzer.java:27) [primefaces-5.2.2.jar:5.2.2]
at org.primefaces.metadata.BeanValidationMetadataExtractor.extractPropertyDescriptor(BeanValidationMetadataExtractor.java:64) [primefaces-5.2.2.jar:5.2.2]
at org.primefaces.metadata.BeanValidationMetadataExtractor.extractConstraintDescriptors(BeanValidationMetadataExtractor.java:51) [primefaces-5.2.2.jar:5.2.2]
at org.primefaces.metadata.BeanValidationMetadataExtractor.extractDefaultConstraintDescriptors(BeanValidationMetadataExtractor.java:46) [primefaces-5.2.2.jar:5.2.2]
at org.primefaces.component.outputlabel.OutputLabelRenderer.isNotNullDefined(OutputLabelRenderer.java:139) [primefaces-5.2.2.jar:5.2.2]
at org.primefaces.component.outputlabel.OutputLabelRenderer.encodeEnd(OutputLabelRenderer.java:121) [primefaces-5.2.2.jar:5.2.2]
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919) [jsf-api-2.2.10.jar:2.2]
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:312) [jsf-impl-2.2.10.jar:2.2.10]
at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:114) [jsf-impl-2.2.10.jar:2.2.10]

I use JUEL EL, perhaps this is the problem?

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
opfau
  • 731
  • 9
  • 37
  • 2
    Can you provide a bit more context? The `` is not from PrimeFaces. It's from Facelets. The `#{}` things are also not from PrimeFaces. It's from JSF and the container. So it's very strange that its behavior is influenced by a PrimeFaces upgrade. This is more likely a misobservation. – BalusC May 07 '15 at 07:17
  • I use juel 2.2.7. If I only change pf version from 5.1.17 to 5.2.2, I get this exception. With 5.1.17 it works without error. – opfau May 07 '15 at 07:41
  • The ui:include is only one example. I had to change it on several places (to stuck at the end on another problem by the way to switch back to 5.1.17) – opfau May 07 '15 at 07:47
  • 3
    Looks like they changed their `ValueExpressionAnalyzer` in an incompatible way. Report an issue. – BalusC May 07 '15 at 07:58
  • Just wondering how this can lead to 5.2 release. – opfau May 07 '15 at 08:30

1 Answers1

1

Based on the stack trace, you've a <p:outputLabel indicateRequired="true"> which would like to check if any @NotNull is defined on the associated bean property. PrimeFaces is using its homegrown org.primefaces.el.ValueExpressionAnalyzer for that which will breakdown the EL expression representing the value of the input component associated with the label component.

However, in 5.2 it was changed as compared to 5.1 as result of fix for issue 8093 of failing EL inspection on null nested properties. Now it doesn't distinguish method expressions anymore. Your best bet is reporting an issue to PrimeFaces guys and tell them to peek at OmniFaces org.omnifaces.el.ExpressionInspector how to do the EL expression analyzing job the right way.

Nonetheless, it's kind of strange that you're referring a readonly value as value of a required input component.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555