表达语言随着主要表面的变化而变化5.2

时间:2015-05-07 07:05:30

标签: jsf-2 primefaces facelets jsf-2.2 juel

使用primefaces 5.1,仅在像#

这样的托管bean中引用getter是没有问题的

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

更改为primefaces 5.2.2我必须

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

并提供一个吸气剂和一个二传手。为什么呢?

例外:

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]

我使用JUEL EL,也许这就是问题?

1 个答案:

答案 0 :(得分:0)

根据堆栈跟踪,您需要<p:outputLabel indicateRequired="true">来检查是否在关联的bean属性上定义了@NotNull。 PrimeFaces正在使用其自己开发的org.primefaces.el.ValueExpressionAnalyzer,它将分解EL表达式,表示与标签组件关联的输入组件的值。

但是,5.2changed相比,5.1issue 8093相比,修复了issue对空嵌套属性进行EL检查失败的结果。现在它不再区分方法表达式了。您最好的选择是向PrimeFaces报告org.omnifaces.el.ExpressionInspector并告诉他们如何以正确的方式查看OmniFaces enter image description here EL表达式分析工作。

尽管如此,您将readonly值称为必需输入组件的值时有点奇怪。