在JSP中使用JSTL时,会得到异常 [英] When using JSTL in JSP, getting an exception
问题描述
<%@ taglib prefix =curi =http: //java.sun.com/jsp/jstl/core%>
异常:
code> java.lang.NoClassDefFoundError:javax / servlet / jsp / tagext / TagLibraryValidator
什么我已经完成了:
- 包含JSTL jar文件WEB-INF / lib文件夹
- 包含Classpath运行配置(使用Eclipse)
- 包含在构建路径中
1:包含JSTL jar文件WEB-INF / lib文件夹
这应该是足够的。
2:运行配置中包含的Classpath(使用Eclipse)
3:包含在
不要做。 Eclipse自动执行1.您需要撤消所有手动更改,这可能会使事情变得更糟。
我已经包括JSTL.jar版本1.2)和JSTL Standard.jar
摆脱 standard.jar
。 JSTL 1.2只包含一个JAR文件。 standard.jar
可能想要定位JSTL 1.2中不存在的类,导致这种抽象/依赖性错误。
另请参见:
Getting following exception when I have included:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
Exception:
java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagLibraryValidator
What I have done:
- Included JSTL jar file WEB-INF/lib folder
- Included Classpath in Run Configuration (using Eclipse)
- Included in Build path too.
1: Included JSTL jar file WEB-INF/lib folder
Fine. That ought to be sufficient.
2: Included Classpath in Run Configuration (using Eclipse)
3: Included in Build path too.
Don't do. Eclipse does that automatically on 1. You need to undo all manual changes, they might make things worse.
I have included JSTL.jar(Version 1.2) and JSTL Standard.jar
Get rid of standard.jar
. JSTL 1.2 consists of only one JAR file. The standard.jar
might want to locate classes which doesn't exist in JSTL 1.2 anymore, resulting in this kind of abstract/dependency errors.
See also:
这篇关于在JSP中使用JSTL时,会得到异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!