Sun JSTL 标记库声明失败,并显示“找不到标记库描述符"; [英] Sun JSTL taglib declaration fails with "Can not find the tag library descriptor"
问题描述
我正在使用 JSP 页面打印一组值.我正在尝试为此使用 JSTL
.
I am using a JSP page to print an array of values. I'm trying to use JSTL <c:forEach>
for this.
<c:forEach items="${objects}" var="object">
<td>${object.name} </td>
</c:forEach>
问题是我的 JSTL taglib 声明:
The problem is my JSTL taglib declaration:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
IDE 在这一行显示错误
The IDE shows an error on this line
找不到标签库描述符.
许多论坛都指向旧的 Sun 站点以下载 JSTL 库.现在所有这些链接都指向 Oracle 主页,而没有链接到 JSTL 二进制文件.这让我相信有一种更新的方法可以实现这一目标.
Many of the forums point to the old Sun site to download the JSTL libraries. Now all of these links point to the Oracle home page with no link to JSTL binaries. This is leading me to believe there is a newer approach to accomplish this.
推荐答案
解决这个问题:
The
jstl jar
should be in your classpath. If you are using maven, add a dependency to jstl in yourpom.xml
using the snippet provided here. If you are not using maven, download the jstl jar from here and deploy it into yourWEB-INF/lib
.
确保您的 jsp
顶部有以下 taglib 指令:
Make sure you have the following taglib directive at the top of your jsp
:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
这篇关于Sun JSTL 标记库声明失败,并显示“找不到标记库描述符";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!