Jsp javax.faces.el.ReferenceSyntaxException:表达式中不支持函数。功能:fn:替换

Jsp javax.faces.el.ReferenceSyntaxException:表达式中不支持函数。功能:fn:替换,jsp,jsf,el,Jsp,Jsf,El,我正在尝试替换Alfresco中JSP文件中的字符串部分,您可以找到它 更具体地说,我想在第54行的全名之后显示更多信息。我所需要的信息作为一个字符串存储在r.id中,格式为GROUP_something,在这里我需要某物。我可以显示r.id而不会出现问题,如下面的代码段中所示,但只要我尝试使用fn:replace删除组前缀,它就会崩溃 原件: <h:outputText id="user-txt" value="#{r.fullName}" rendered="#{r.isGroup}"

我正在尝试替换Alfresco中JSP文件中的字符串部分,您可以找到它

更具体地说,我想在第54行的全名之后显示更多信息。我所需要的信息作为一个字符串存储在r.id中,格式为GROUP_something,在这里我需要某物。我可以显示r.id而不会出现问题,如下面的代码段中所示,但只要我尝试使用fn:replace删除组前缀,它就会崩溃

原件:

<h:outputText id="user-txt" value="#{r.fullName}" rendered="#{r.isGroup}" />
同样有效的还有:

<h:outputText id="user-txt" value="#{r.fullName} (#{r.id})" rendered="#{r.isGroup}" />
不工作:

<h:outputText id="user-txt" value="#{r.fullName} (#{fn:replace(r.id, 'GROUP_', '')})" rendered="#{r.isGroup}" />
完整代码:

完整堆栈跟踪如下所示:

javax.faces.FacesException: An exception occurred processing JSP page /jsp/dialog/container.jsp at line 194 191: 192: 193: 194: " /> 195: 196: 197: Stacktrace: caused by: org.apache.jasper.JasperException: An exception occurred processing JSP page /jsp/dialog/container.jsp at line 194 191: 192: 193: 194: " /> 195: 196: 197: Stacktrace: caused by: org.apache.jasper.JasperException: javax.faces.FacesException: Exception while calling encodeEnd on : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /jsp/dialog/container.jsp][Class: javax.faces.component.html.HtmlForm,Id: dialog][Class: javax.faces.component.UINamingContainer,Id: dialog-body][Class: org.alfresco.web.ui.common.component.UIPanel,Id: users-panel][Class: org.alfresco.web.ui.common.component.data.UIRichList,Id: users-list][Class: org.alfresco.web.ui.common.component.data.UIColumn,Id: _idJsp17][Class: javax.faces.component.html.HtmlOutputText,Id: user-txt]} caused by: javax.faces.FacesException: Exception while calling encodeEnd on : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /jsp/dialog/container.jsp][Class: javax.faces.component.html.HtmlForm,Id: dialog][Class: javax.faces.component.UINamingContainer,Id: dialog-body][Class: org.alfresco.web.ui.common.component.UIPanel,Id: users-panel][Class: org.alfresco.web.ui.common.component.data.UIRichList,Id: users-list][Class: org.alfresco.web.ui.common.component.data.UIColumn,Id: _idJsp17][Class: javax.faces.component.html.HtmlOutputText,Id: user-txt]} caused by: javax.faces.FacesException: Could not retrieve value of component with path : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /jsp/dialog/container.jsp][Class: javax.faces.component.html.HtmlForm,Id: dialog][Class: javax.faces.component.UINamingContainer,Id: dialog-body][Class: org.alfresco.web.ui.common.component.UIPanel,Id: users-panel][Class: org.alfresco.web.ui.common.component.data.UIRichList,Id: users-list][Class: org.alfresco.web.ui.common.component.data.UIColumn,Id: _idJsp17][Class: javax.faces.component.html.HtmlOutputText,Id: user-txt]} caused by: javax.faces.el.EvaluationException: Cannot get value for expression '#{r.fullName} (#{fn:replace(r.id, 'GROUP_', '')})' caused by: javax.faces.el.ReferenceSyntaxException: Functions not supported in expressions. Function: fn:replace 我无法理解这个错误,因为其他答案(例如)或提倡这种确切的方法

我还添加了函数taglib:

<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
在标题中

感谢您的帮助

编辑:关于环境的更多信息:我正在使用Alfresco的捆绑版本,使用Tomcat7.0.30作为容器。使用以下版本的库:

JSF Apache MyFaces v1.1.8 MyFaces-api-1.1.8.jar和MyFaces-impl-1.1.8.jar JSP Tomcat的内置Jasper Jasper.jar 我认为这是Tomcat通过EL-api.jar和Jasper-EL.jar内置的Jasper EL,尽管Alfresco也将commons-EL.jar与规范版本2.0和实现版本1.0捆绑在一起
显示以前从未见过的完整jsp页面代码。哪个JSF impl/版本?EL impl/版本?嗨,BalusC,我试着在panelGroup中包装outputText,但错误依然存在。我更新了这篇文章,提供了关于图书馆版本的更多信息。感谢您的关注:看一看您是否以这样一种方式编写了,它代表了唯一的个人EL表达式?包装在面板组中本身并不是关键,它只是为了打印所需的id。因此,请按如下方式编写代码: