分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 运营维护

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

发布时间:2023-09-06 01:20责任编辑:赖小花关键词:jsjsp

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

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved