zoukankan      html  css  js  c++  java
  • 恼人的The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved...错误,无奈用Struts的bean:write替代了JSTL的C:out

    一个应用中有两个页面使用了JSTL的c:out输出,就类似这么简单三句

    <c:if test="${!empty error}">
           <h2><c:out value="${error}"/></h2>
     </c:if>

    应用在本地MyEclipse中的Tomcat6跑得正常,但放到CentOS的Tomcat7上出现了错误

    The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application

    于是网上一顿找,按网文指点把JSTL需要的jstl.jar和standard.jar放到服务器的Tomcat7的lib目录下,重启T,结果还是无效,涛声依旧,错误依旧。

    按另一网文指示,更烦,需要找一批TLD文件到web-inf下,还要在web.xml中进行配置。

    这时有点火了,JSTL也没啥优势,还值得为它费这么大力气?

    联想到应用使用了Struts的Template,其它东西没有用到但是所有包和TLD都配置好了,于是决定用Struts的bean:write替代了JSTL的C:out,上面的三段话就成了

    <logic:present name="error">
          <h2><bean:write name="error"/></h2>
    </logic:present>

    再发布一次,这回成了,出错的页面不捣乱了。

    JSTL,既然你不好用,那就让好用的来取代你,除非你不可取代。

    老板对员工是这样,程序猿对框架API组件等也是这样。

  • 相关阅读:
    hdu5360 Hiking(水题)
    hdu5348 MZL's endless loop(欧拉回路)
    hdu5351 MZL's Border(规律题,java)
    hdu5347 MZL's chemistry(打表)
    hdu5344 MZL's xor(水题)
    hdu5338 ZZX and Permutations(贪心、线段树)
    hdu 5325 Crazy Bobo (树形dp)
    hdu5323 Solve this interesting problem(爆搜)
    hdu5322 Hope(dp)
    Lightoj1009 Back to Underworld(带权并查集)
  • 原文地址:https://www.cnblogs.com/heyang78/p/4051260.html
Copyright © 2011-2022 走看看