Sun JSTL taglib声明失败,并显示“找不到标签库描述符". [英] Sun JSTL taglib declaration fails with "Can not find the tag library descriptor"

查看:288
本文介绍了Sun JSTL taglib声明失败,并显示“找不到标签库描述符".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用JSP页面来打印值数组.我正在尝试为此使用JSTL <c:forEach>.

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

找不到标签库描述符.

Can not find the tag library descriptor.

许多论坛都指向旧的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.

推荐答案

要解决此问题:

  1. jstl jar应该在您的类路径中.如果您正在使用 maven ,请使用此处,并将其部署到您的WEB-INF/lib.

  1. The jstl jar should be in your classpath. If you are using maven, add a dependency to jstl in your pom.xml using the snippet provided here. If you are not using maven, download the jstl jar from here and deploy it into your WEB-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 taglib声明失败,并显示“找不到标签库描述符".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆