在尝试使用JSTL时,我在使用maven时遇到了一个奇怪的错误:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>我认为这是因为它不是一个具体的实现。似乎在Glassfish中有一个具体的实现,但我不知道如何包含它。
我得到的错误是这样的:
java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/servlet/jsp/jstl/core/LoopTagSupport或
java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/servlet/jsp/jstl/core/ConditionalTagSupport发布于 2011-07-29 23:44:11
如果您使用的应用服务器已经提供了JSTL实现,那么将<scope>provided</scope>添加到您的定义中就足够了,否则您可以尝试添加
<dependency> <groupId>org.glassfish.web</groupId> <artifactId>jstl-impl</artifactId> <version>1.2</version> </dependency>
https://stackoverflow.com/questions/6873878
复制相似问题