我在使用 Maven 和 Eclipse 制作我的第一个 Web 项目时遇到了问题...
我是maven的新手,我正在努力学习它。我已经使用 Eclipse 和 Coding Web 和 Spring 项目很长时间了,但从未使用过 Maven,所以我想学习它。
我使用 archetype 创建新的 Maven 项目:maven-archetype-webapp 从 eclipse 中创建,然后我对 POM.XML 进行更改以具有以下内容:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springsource.greenbeans.maven</groupId>
<artifactId>WebFlowTemplate</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>WebFlowTemplate Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.1.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.webflow</groupId>
<artifactId>spring-webflow</artifactId>
<version>2.3.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>3.1.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>3.1.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>3.1.2.RELEASE</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
<build>
<finalName>WebFlowTemplate</finalName>
</build>
</project>
然后我做了一个小的index.jsp来测试:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<html>
<head>
<title>Spring 3.0 MVC Series</title>
</head>
<body>
<a href="login.jsp">Login</a><p><p>
<a href="hello.html">Say Hello (Spring MVC)</a><p>
<a href="./helloworld">Say Hello (Spring-Web-Flow)</a>
</body>
</html>
但我在 taglib 行上遇到错误:
描述资源路径位置类型
Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/core" input.jsp /WebFlowTemplate/src/main/webapp/WEB-INF/flows/helloworld line 1 JSP Problem
为什么 JSP 找不到标签库?
最佳答案
jSTL 的 URI 应该类似于:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
查看讨论here了解更多信息。
关于java - 使用 Maven 和 Eclipse 制作我的第一个 Web 项目时遇到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12392354/