简体   繁体   English

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

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

I am trying to use the following tag lib in my JSP page : 我试图在我的JSP页面中使用以下标记库:

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

But Eclipse shows me this error : 但是Eclipse向我显示了此错误:

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

I am already having JSTL in my classpath using this dependency : 我已经使用此依赖项在我的类路径中有了JSTL:

<dependency>
  <artifactId>javaee-api</artifactId>
  <version>7.0</version>
  <scope>provided</scope>
</dependency>

I use WildFly 9. 我使用WildFly 9。

I have the same problem with these 2 other taglibs : 我对这两个其他taglib有相同的问题:

<%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>

Remark : The following link is giving 404 HTTP error : http://central.maven.org/maven2/javax/servlet/jsp/jstl/jstl/1.2/jstl-1.2.jar 备注 :以下链接给出了404 HTTP错误: http : //central.maven.org/maven2/javax/servlet/jsp/jstl/jstl/1.2/jstl-1.2.jar

Thank you. 谢谢。

If your web application uses JSTL directly, for JSTL 1.0, the namespace is http://java.sun.com/jstl/core . 如果您的Web应用程序直接使用JSTL,则对于JSTL 1.0,名称空间为http://java.sun.com/jstl/core In JavaEE 5, JSTL 1.1 is included, the namespace is http://java.sun.com/jsp/jstl/core . 在JavaEE 5中,包含JSTL 1.1,名称空间为http://java.sun.com/jsp/jstl/core In JaveEE 6 and JavaEE 7, JSTL 1.2 is included, the namespace is http://java.sun.com/jsp/jstl/core . 在JaveEE 6和JavaEE 7中,包括JSTL 1.2,名称空间为http://java.sun.com/jsp/jstl/core

But if your web application uses JSF+Facelets, for JSF 1.x+Facelets 1.x in JaveEE 5, the namespace is http://java.sun.com/jstl/core . 但是,如果您的Web应用程序使用JSF + Facelets,则对于JaveEE 5中的JSF 1.x + Facelets 1.x,名称空间为http://java.sun.com/jstl/core For JSF 2.0+Facelets 2.x in JavaEE 6, the namespace is http://java.sun.com/jsp/jstl/core . 对于JavaEE 6中的JSF 2.0 + Facelets 2.x,名称空间为http://java.sun.com/jsp/jstl/core For JSF 2.2+Facelets 2.2 in JavaEE 7, the namespace is http://xmlns.jcp.org/jsp/jstl/core . 对于JavaEE 7中的JSF 2.2 + Facelets 2.2,名称空间为http://xmlns.jcp.org/jsp/jstl/core

The Java EE 7 Tutorial briefly states the new URIs for JSTL in the What Is Facelets section as : Java EE 7教程在“ 什么是Facelets”部分中将JSTL的新URI简要说明为:

However, I have yet to find an implementation of the taglibs that use the URI. 但是,我还没有找到使用URI的taglib的实现。 So the URIs (with their recommended namespaces) should be defined as: 因此,URI(及其推荐的命名空间)应定义为:

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

And to get rid of the error you need an implementation of the JSTL loaded as a dependency in provided scope eg 为了摆脱错误,您需要在provided范围内将JSTL的实现加载为依赖项,例如

<dependency>
  <groupId>jstl</groupId>
  <artifactId>jstl</artifactId>
  <version>1.2</version>
  <scope>provided</scope>
</dependency>

The provided scope prevents it from being included into the WAR file since the one being used by the application server should be used. provided作用域可防止将它包含在WAR文件中,因为应使用应用程序服务器正在使用的范围。

暂无
暂无

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

相关问题 找不到“http://java.sun.com/jsp/jstl/core”的标签库描述符 - Can not find the tag library descriptor for “http://java.sun.com/jsp/jstl/core” Eclipse - 找不到 uri http://java.sun.com/jsf/html 的 facelet 标签库 - Eclipse - Can't find facelet tag library for uri http://java.sun.com/jsf/html &lt;%@ taglib prefix=&quot;c&quot; uri=&quot;http://java.sun.com/jsp/jstl/core&quot; %&gt; Eclipse photon jdk 10 Tomcat 9 - <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> Eclipse photon jdk 10 Tomcat 9 无法在web.xml或使用此应用程序部署的jar文件中解析http://java.sun.com/jsp/jstl/core - http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application 在Eclipse WTP中从Tomcat 7迁移到8:绝对uri:http://java.sun.com/jstl/core无法解析 - Migrating from Tomcat 7 to 8 in Eclipse WTP: The absolute uri: http://java.sun.com/jstl/core cannot be resolved Eclipse - 绝对 uri:http://java.sun.com/jsp/jstl/core 无法在 web.xml 或使用此应用程序部署的 jar 文件中解析 - Eclipse -The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application PWC6188:绝对 uri:http://java.sun.com/jsp/jstl/core 无法在 web.xml 或使用此应用程序部署的 jar 文件中解析 - PWC6188: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application 我的taglib错误&lt;%@ taglib prefix =“portlet”uri =“http://java.sun.com/portlet_2_0”%&gt; - Error in my taglib <%@ taglib prefix=“portlet” uri=“http://java.sun.com/portlet_2_0”%> 引用的文件包含错误 (http://java.sun.com/xml/ns/javaee/web-app.xsd) - Referenced file contains errors (http://java.sun.com/xml/ns/javaee/web-app.xsd) Eclipse“找不到自定义标签的标签库描述符”(不是JSTL!) - Eclipse “cannot find the tag library descriptor” for custom tags (not JSTL!)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM