简体   繁体   English

找不到“http://java.sun.com/jsp/jstl/core”的标签库描述符

[英]Can not find the tag library descriptor for “http://java.sun.com/jsp/jstl/core”

I'm trying to use JSTL, but I get the following error:我正在尝试使用 JSTL,但出现以下错误:

Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/core"

How is this caused and how can I solve it?这是怎么引起的,我该如何解决?

Use taglib definition in your JSP or better include it in every page by the first line.在您的 JSP 中使用 taglib 定义,或者更好地将它包含在每个页面的第一行。

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

There's also fix jstl-1.2 dependency in your project.在您的项目中还修复了jstl-1.2依赖项。 Also use servlet specification at least 2.4 in your web.xml .还要在web.xml使用至少 2.4 的 servlet 规范。

The maven dependencies are (maven is a open source development tool) maven依赖是(maven是一个开源开发工具)

<dependency>
  <groupId>jstl</groupId>
  <artifactId>jstl</artifactId>
  <version>1.2</version>
  <scope>compile</scope>
</dependency>
<dependency>
  <groupId>taglibs</groupId>
  <artifactId>standard</artifactId>
  <version>1.1.2</version>
  <scope>compile</scope>
</dependency>

In the web.xml start writingweb.xml开始写

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" 
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

EDIT:编辑:

I'd like to add a note that @informatik01 has mentioned in the comment about newer version of JSTL libraries available from Maven repository: JSTL version 1.2.1 API and JSTL 1.2.1 .我想添加一个注释,@informatik01 在关于 Maven 存储库中可用的 JSTL 库的较新版本的评论中提到: JSTL version 1.2.1 APIJSTL 1.2.1

I had the same problem even after I added jar files for jstl and standard.即使在为 jstl 和标准添加了 jar 文件后,我也遇到了同样的问题。 For me, it resolved after I added a Targeted runtime for my project.对我来说,它在我为我的项目添加目标运行时后解决了。

Go to Project Properties > Targeted Runtimes and select the server you are using (Tomcat 7.0 for me).转到 Project Properties > Targeted Runtimes 并选择您正在使用的服务器(对我来说是 Tomcat 7.0)。

create a libs folder in the inside WEB-INF directory and add jstl, standard jars as below.在WEB-INF目录下创建libs文件夹,添加jstl,标准jar包如下。在此处输入图片说明

You may try to make the folder which include jsp-s become the source folder of eclipse, that solved the same problem of mine.您可以尝试将包含jsp-s的文件夹变成eclipse的源文件夹,解决了我的同样问题。 As below:如下:

  1. open project's properties.(right click project, then choose the Properties)打开项目的属性。(右键单击项目,然后选择属性)
  2. choose Java Build Path, select the Source tab, click Add Folder and choose the folder including your jsp-s, OK选择 Java Build Path,选择 Source 选项卡,单击 Add Folder 并选择包含您的 jsp-s 的文件夹,OK

您只需要在项目构建路径中包含standard.jar文件。

in your pom.xml just add在你的 pom.xml 中添加

    <!-- jstl -->
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency> 

and try run并尝试运行

mvn eclipse:eclipse -Dwtpversion=2.0

will solve the problem将解决问题

I have similar issue, why should we add external jar files when we are using maven?我有类似的问题,为什么我们在使用 maven 时要添加外部 jar 文件?

I have already included jstl maven dependency then also I encounter error "Can not find the tag library descriptor for " http://java.sun.com/jsp/jstl/core "".我已经包含了 jstl maven 依赖项,然后我也遇到错误“找不到“ http://java.sun.com/jsp/jstl/core ”的标签库描述符。 Then I include following dependency then error get solve, without including any single external jar file.然后我包含以下依赖项,然后错误得到解决,不包含任何单个外部 jar 文件。

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>servlet-api</artifactId>
    <version>2.5</version>
</dependency>

添加这 3 个文件以提供运行时支持`

As per snapshot the main reason for error is that you are not defining c.tld in lib folder causes such error.根据快照,错误的主要原因是您没有在 lib 文件夹中定义c.tld导致此类错误。

This lib content information about taglib这个lib关于taglib的内容信息

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 JSP错误“找不到“ http://java.sun.com/jsp/jstl/core”的标记库描述符 - JSP error “Can not find the tag library descriptor for ”http://java.sun.com/jsp/jstl/core" 找不到“http://java.sun.com/jsp/jstl/core”的标签库描述符 - Can not find the tag library descriptor for “http://java.sun.com/jsp/jstl/core” 找不到为http://java.sun.com/jsp/jstl/core描述的标签或库 - Can't find tag or library described for http://java.sun.com/jsp/jstl/core Hybris抛出uri:无法解决http://java.sun.com/jsp/jstl/core - Hybris throws uri: http://java.sun.com/jsp/jstl/core can not be solved Docusign java集成有错误“http://java.sun.com/jsp/jstl/core无法解析” - Docusign java integration having error “ http://java.sun.com/jsp/jstl/core cannot be resolved” 绝对URI:无法解析http://java.sun.com/jsp/jstl/core - The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved Jetty 9.0 绝对uri:http://java.sun.com/jsp/jstl/core 无法解析 - Jetty 9.0 The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved 绝对URI:[http://java.sun.com/jsp/jstl/core]无法解决错误 - The absolute uri: [http://java.sun.com/jsp/jstl/core] cannot be resolved error Eclipse - 找不到 uri http://java.sun.com/jsf/html 的 facelet 标签库 - Eclipse - Can't find facelet tag library for uri http://java.sun.com/jsf/html Apache Tomcat 10.0.0-M1 使用 JSP Absolute uri http://java.sun.com/jsp/jstl/core 无法解析 - Apache Tomcat 10.0.0-M1 using JSP Absolute uri http://java.sun.com/jsp/jstl/core cannot be resolved
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM