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

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

问题描述

我正在使用 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.

推荐答案

解决这个问题:

  1. jstl jar 应该在你的类路径中.如果您使用 maven,请使用 这里.如果您不使用 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 标记库声明失败,并显示“找不到标记库描述符";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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