zoukankan      html  css  js  c++  java
  • websphere中jsp使用el表达式 ${fn.replace}报错- 'fn:replace' not found

    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

  • 相关阅读:
    html+css学习
    mac安装软件系列
    Versions 出现 SVN Working Copy xxx locked
    linux安装gcc-c++
    linux常用命令
    linux挂载磁盘
    对jquery新增加的class绑定事件
    linux下安装php的mcrypt拓展
    Linux关闭selinux
    linux安装包资源库
  • 原文地址:https://www.cnblogs.com/xiaozhuyuan/p/7728025.html
Copyright © 2011-2022 走看看