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

  • 相关阅读:
    支付方法及注意事项
    网站负载均衡策略
    工作成长
    java内存机制
    关于前途的一些思考
    git记录
    关于博客
    如何为公司创造价值?
    遍历集合方法总结
    二叉树和红黑二叉树
  • 原文地址:https://www.cnblogs.com/xiaozhuyuan/p/7728025.html
Copyright © 2011-2022 走看看