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

时间:2013-12-11 14:27:11

标签: java spring jsp maven

目前,我使用'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>

所有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
...

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

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

但是当我执行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

2 个答案:

答案 0 :(得分:4)

如果您打开spring-webmvc-3.1.0-RELEASE.jar/META-INF/spring-form.tld,则使用<uri>

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

所以你应该

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

答案 1 :(得分:3)

在pom.xml中添加此依赖项

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