使用c:forEach tomcat ver7.0时JSTL错误javax / servlet / jsp / jstl / core / LoopTag错误 [英] JSTL error javax/servlet/jsp/jstl/core/LoopTag error when using c:forEach tomcat ver7.0
问题描述
eclipse juno,动态web项目
apache Tomcat v7.0(它有自己的jstl-1.2.1.jar)
我得到这个错误<
$ p $
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)
$ c当我尝试运行这个jsp代码时,
$ b
<%@ taglib prefix =curi =http://java.sun.com/jsp/jstl/core%>
<%@ page language =javacontentType =text / html; charset = ISO-8859-1
pageEncoding =ISO-8859-1%>
<!DOCTYPE html PUBLIC - // W3C // DTD HTML 4.01 Transitional // ENhttp://www.w3.org/TR/html4/loose.dtd\">
< html>
< head>
< meta http-equiv =Content-Typecontent =text / html; charset = ISO-8859-1>
< title>在此插入标题< / title>
< / head>
< body>
< c:forEach var =testitems =a,b,c>
$ {test}
< / c:forEach>
< / body>
< / html>
它不会看到javax.servlet.jsp.jstl.core.LoopTag类在jar中
我已经阅读了一些关于过滤器阻塞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
t包含 javax.servlet.jsp.jstl.core
类。请务必添加 jstl-1.2.jar
。 Hi using
eclipse juno, dynamic web project
apache Tomcat v7.0 (which has its own jstl-1.2.1.jar)
I get this error
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)
when I try running this jsp code
<%@ 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>
it seams not to be seeing the javax.servlet.jsp.jstl.core.LoopTag class that is in the jar
I have read something about filters blocking javax.servlet files
any help would be greatly appreciated
ok I think I have found the solution
javax.servlet.jsp.jstl-1.2.1.jar
does not contain the javax.servlet.jsp.jstl.core classes
jstl-1.2.jar needs to be added as well
javax.servlet.jsp.jstl-1.2.1.jar
doesn't contain the javax.servlet.jsp.jstl.core
classes. Be sure to add jstl-1.2.jar
as well.
这篇关于使用c:forEach tomcat ver7.0时JSTL错误javax / servlet / jsp / jstl / core / LoopTag错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!