java.lang.NoClassDefFoundError:javax/servlet/jsp/tagext/TagLibraryValidator [英] java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagLibraryValidator

查看:1907
本文介绍了java.lang.NoClassDefFoundError:javax/servlet/jsp/tagext/TagLibraryValidator的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照此链接中的指南进行安装JSTL,但是在尝试启动JSP时遇到以下错误页面:

I followed the guide in this link to install JSTL but I got the following error when I tried to launch my JSP page:

java.lang.NoClassDefFoundError:javax/servlet/jsp/tagext/TagLibraryValidator

java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagLibraryValidator

taglib声明为:

The taglib declaration is:

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

我在Tomcat webapps中的/WEB-INF/lib下安装了JSTL 1.1,并试图在我的项目中执行同样的操作,但是没有用.我还尝试了JSTL的1.2版,并且仍然出现相同的消息.这是怎么引起的,我该如何解决?

I installed JSTL 1.1 under /WEB-INF/lib in Tomcat webapps and tried to do the same in my project, but it didn't work. I also tried version 1.2 of JSTL and still the same message. How is this caused and how can I solve it?

推荐答案

javax.servlet.jsp.tagext.TagLibraryValidator 类.因此,此错误可能具有以下可能的原因:

The javax.servlet.jsp.tagext.TagLibraryValidator class is introduced in JSP 2.0. This error can thus have the following possible causes:

  • 您没有运行与JSP 2.0兼容的serlvetcontainer.例如,Tomcat 4.x或5.0.您至少需要Tomcat 5.5或更高版本,6.0甚至更好的版本7.0.只是最新版本.

  • You are not running a JSP 2.0 compatible serlvetcontainer. For example, Tomcat 4.x or 5.0. You need at least Tomcat 5.5 or better, 6.0, or even better, 7.0. Just the latest version.

您已经随意地下载了jsp-api.jarj2ee.jar文件或包含JSP API的任何文件,从而使/WEB-INF/lib混乱不堪,该文件源自完全不同的servlet容器make/version,而该servlet/容器版本实际上与JSP 2.0不兼容.摆脱那些图书馆.您不需要它们.如果您这样做是为了解决编译错误,那么您做错了方法.它们应该以编译时类路径结尾,而不是运行时类路径结尾.另请参见如何导入javax我的Eclipse项目中的.servlet API?

You have cluttered the /WEB-INF/lib with arbitrarily downloaded jsp-api.jar or j2ee.jar files or whatever contains the JSP API, which originates from a completely different servletcontainer make/version which in turn was actually not JSP 2.0 compliant. Get rid of those libraries. You don't need them. If you did this to workaround compilation errors, then you did it the wrong way. They should end up in compiletime classpath, not in the runtime classpath. See also How do I import the javax.servlet API in my Eclipse project?

这篇关于java.lang.NoClassDefFoundError:javax/servlet/jsp/tagext/TagLibraryValidator的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆