码迷,mamicode.com
首页 > 编程语言 > 详细

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

时间:2014-10-26 01:34:12      阅读:192      评论:0      收藏:0      [点我收藏+]

标签:http   io   os   ar   使用   java   sp   文件   on   

一个应用中有两个页面使用了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中进行配置。

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

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

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

JSTL,既然你不好用,那就让好用的来取代你,除非你不可取代。这个老板对员工的政策被我用上了。

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

标签:http   io   os   ar   使用   java   sp   文件   on   

原文地址:http://www.cnblogs.com/xiandedanteng/p/4051260.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!