您好,使用 eclipse juno,动态 Web 项目
apache Tomcat v7.0(有自己的jSTL-1.2.1.jar)
我得到这个错误
javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/LoopTag
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:343)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
当我尝试运行此 jsp 代码时
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!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>
<c:forEach var="test" items="a,b,c">
${test}
</c:forEach>
</body>
</html>
它接缝没有看到 jar 中的 javax.servlet.jsp.jSTL.core.LoopTag 类
我已经阅读了一些关于过滤器阻塞 javax.servlet 文件的内容
任何帮助将不胜感激
好的,我想我已经找到了解决方案
javax.servlet.jsp.jSTL-1.2.1.jar
不包含 javax.servlet.jsp.jSTL.core 类
还需要添加jSTL-1.2.jar
最佳答案
javax.servlet.jsp.jstl-1.2.1.jar
不包含 javax.servlet.jsp.jstl.core
类。一定要添加 jstl-1.2.jar
。
关于tomcat - JSTL 错误 javax/servlet/jsp/jSTL/core/LoopTag 使用 c:forEach tomcat ver7. 时出错 0,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/12693969/