当使用param将值映射到方法时,如何避免JSF <h:outputtext>中的EL错误?

时间:2018-02-22 08:20:55

标签: java jsf primefaces el

我有这种情况完美,我知道我将bean属性映射到outputText的值而不是方法,但在这种情况下这是必要的。那我怎么能避免这个问题呢?

<h:outputText value="#{bean.method(param)}" />
  

错误:在此行找到多个注释:

     
      
  • EL中的语法错误
  •   
  • 表达式必须是值表达式,但是方法
  •   

我的faces-config.xml

<?xml version="1.0" encoding="UTF-8"?>

<faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
    version="2.2">

    <application>
        <locale-config>
            <default-locale>es</default-locale>
            <supported-locale>es</supported-locale>
            <supported-locale>en</supported-locale>
        </locale-config>
        <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
    </application>
</faces-config>

我在here中看到,如果我升级我的EL解析器,问题应该消失但是我该怎么做?

我正在使用带有JDK1.8的Java EE和tomcat 8以及PrimeFaces

<jsf.version>2.2.13</jsf.version>
<primeFaces.version>6.0</primeFaces.version>
<java.version>1.8</java.version>

0 个答案:

没有答案