Ich habe JSTL-Code und es baut von Maven gut ... Aber Eclipse hatte Kompilierungsfehler "Unbekanntes Tag (C: foreach)."Unbekanntes Tag (c: foreach). in Eclipse
Code sind hier:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<ul>
<c:forEach items="${listOfMyFriends}" var="friend">
<c:out value="${friend}"></c:out>
</c:forEach>
</ul>
</body>
</html>
jemand helfen könnte mir diese promlem zu vermeiden?
Es gibt volle pom: ` http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0
<groupId>com.godzevych</groupId>
<artifactId>springInActionMVCTemplate</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>springInActionMVCTemplate</name>
<url>http://maven.apache.org</url>
<properties>
<java.version>1.6</java.version>
<spring.version>3.1.0.RELEASE</spring.version>
<cglib.version>2.2.2</cglib.version>
</properties>
<dependencies>
<!-- Spring core & mvc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>test</scope>
</dependency>
<!-- CGLib for @Configuration -->
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
<version>${cglib.version}</version>
<scope>runtime</scope>
</dependency>
<!-- Servlet Spec -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<!-- JSTL -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>
<!-- JSR 330 -->
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>springsource-milestones</id>
<name>SpringSource Milestones Proxy</name>
<url>https://oss.sonatype.org/content/repositories/springsource-milestones</url>
</repository>
</repositories>
<build>
<finalName>springInActionMVCTemplate</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>
`
Sie diese Abhängigkeit hinzugefügt haben? javax.servlet jstl 1,2 bereitgestellt –
ja, aber ohne Rahmen ... jetzt hinzufügen, aber keine Änderungen ... –
JSTL 1.2 erfordert mindestens Servlet 2.4 Erklärung in web .xml. Stellen Sie daher sicher, dass Ihre web.xml über die richtige Stammdeklaration verfügt, vorzugsweise die höchste unterstützte Version, die von Ihrem Servlet-Container unterstützt wird (Tomcat 7 ist Servlet 3.0, Tomcat 6 ist Servlet 2.5 und Tomcat 5.5 ist Servlet 2.4). –