Java 绝对 uri:http://www.springsource.org/tags/form 无法在 web.xml 或使用此应用程序部署的 jar 文件中解析

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20521730/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 02:31:19  来源:igfitidea点击:

The absolute uri: http://www.springsource.org/tags/form cannot be resolved in either web.xml or the jar files deployed with this application

javaspringjspmaven

提问by user2274060

Currently, I use a 'Maven' project where I put in my pom.xml the current dependencies to use Spring Framework where org.springframework.version = 3.1.0.RELEASE :

目前,我使用了一个“Maven”项目,我在 pom.xml 中放入了当前依赖项以使用 Spring Framework,其中 org.springframework.version = 3.1.0.RELEASE :

<dependency>
   <groupId>org.springframework</groupId>
   <artifactId>spring-core</artifactId>
   <version>${org.springframework.version}</version>
</dependency>

<dependency>
   <groupId>org.springframework</groupId>
   <artifactId>spring-context</artifactId>
   <version>${org.springframework.version}</version>
</dependency>

<!-- Spring MVC framework -->
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-webmvc</artifactId>
    <version>${org.springframework.version}</version>
</dependency>

<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-taglibs</artifactId>
    <version>${org.springframework.version}</version>
</dependency>

All the jar dependencies are sitting in target/myGoogleAppEngine-0.0.1-SNAPSHOT/WEB-INF/lib. This directory contains :

所有 jar 依赖项都位于 target/myGoogleAppEngine-0.0.1-SNAPSHOT/WEB-INF/lib 中。该目录包含:

spring-aop-3.1.0.RELEASE.jar
spring-beans-3.1.0.RELEASE.jar
spring-webmvc-3.1.0.RELEASE.jar
spring-web-3.1.0.RELEASE.jar
spring-security-taglibs-3.1.0.RELEASE.jar
spring-security-web-3.1.0.RELEASE.jar
...

At the beginning of my address.jsp, I've the following line :

在我的 address.jsp 的开头,我有以下行:

<%@ taglib prefix="form" uri="http://www.springsource.org/tags/form" %>

But I've the following error when I execute the address.jsp :

但是当我执行 address.jsp 时出现以下错误:

Error 500
org.apache.jasper.JasperException: The absolute uri: http://www.springsource.org/tags/form cannot be resolved in either web.xml or the jar files deployed with this application

回答by Sotirios Delimanolis

If you open up spring-webmvc-3.1.0-RELEASE.jar/META-INF/spring-form.tldthe <uri>to use is

如果你打开spring-webmvc-3.1.0-RELEASE.jar/META-INF/spring-form.tld<uri>到是使用

<uri>http://www.springframework.org/tags/form</uri>

So you should have

所以你应该有

<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

回答by Smith

Add this dependency in pom.xml

在 pom.xml 中添加此依赖项

<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-taglibs</artifactId>
    <version>Your Security Version</version>
</dependency>