首页 > Web开发 > 详细

websphere中jsp使用el表达式 ${fn.replace}报错- 'fn:replace' not found

时间:2017-10-25 12:50:56      阅读:792      评论:0      收藏:0      [点我收藏+]

websphere发布应用,jsp的el表达式 ${fn.replace}报错:

[10/24/17 19:02:45:181 CST] 00000038 servlet E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: An exception was thrown by one of the service methods of the servlet [/WEB-INF/jsp/modules/xx/xx.jsp] in application [xx_war]. Exception created : [javax.el.ELException: Function ‘fn:replace‘ not found

at org.apache.el.lang.ExpressionBuilder.visit(ExpressionBuilder.java:197)
at

错误原因:websphere不能正确处理单引号包裹的el表达式的函数。

 技术分享

解决方法:在el表达式外面用双引号包裹,而不是单引号。

例子如下:

有问题的jsp代码

<div  id =‘${fn:replace(pdata.attributes.type, "|", "_")}_invest${ind.index}‘ ></div>

修改为:

<div  id ="${fn:replace(pdata.attributes.type, ‘|‘, ‘_‘)}_invest${ind.index}" ></div>

 

 

参考:

https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014934503

 

websphere中jsp使用el表达式 ${fn.replace}报错- 'fn:replace' not found

原文:http://www.cnblogs.com/xiaozhuyuan/p/7728025.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!