This absolute uri http://Java.sun.com/jsp/jstl/core) cannot be resolved in either web.xml or the jar

JSTL标签库引入失败


关于JSP中报异常:

   org.apache.jasper.JasperException:
       This absolute uri http://Java.sun.com/jsp/jstl/core) cannot be resolved in either web.xml or the jar files deployed with this application

       

按照上面的改过之后,大体有两种解决方法:

       第一种就是在Eclipse的工程中导入JSTL1.1后,下载JSTL1.1  http://jakarta.apache.org/taglibs/index.html---jstl.jra  standard.jar 两jar包
然后解压,把*.jar和*.tld放到/WEB-INF/lib目录下。也就是将所有的jakarta-taglibs-standard-current.zip(JSTL的类库)中的.jar和.tlb放到WEB-INF目录下的lib文件夹中,JSP文件中导入<%@ taglib prefix="c" uri="/WEB-INF/lib/c.tld" %>,经试验是可以的。
       第二种是修改web.xml,把下载的c.tld、x.tld、fmt.tld三个文件放到web-inf下,web文件增加下面的语句:
<jsp-config>
   <taglib>
    <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
    <taglib-location>/WEB-INF/c.tld</taglib-location>
   </taglib>
   <taglib>
    <taglib-uri>http://java.sun.com/jsp/jstl/xml</taglib-uri>
    <taglib-location>/WEB-INF/x.tld</taglib-location>
   </taglib>
   <taglib>
    <taglib-uri>http://java.sun.com/jsp/jstl/fmt</taglib-uri>
    <taglib-location>/WEB-INF/fmt.tld</taglib-location>
   </taglib>
   <taglib>
    <taglib-uri>http://java.sun.com/jsp/jstl/sql</taglib-uri>
    <taglib-location>/WEB-INF/sql.tld</taglib-location>
   </taglib>
</jsp-config>

       JSP中导入

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

应该就OK了


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值