在JSP中使用JSTL时,会得到异常 [英] When using JSTL in JSP, getting an exception

查看:148
本文介绍了在JSP中使用JSTL时,会得到异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

异常:

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

什么我已经完成了:


  1. 包含JSTL jar文件WEB-INF / lib文件夹

  2. 包含Classpath运行配置(使用Eclipse)

  3. 包含在构建路径中


解决方案


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:

  1. Included JSTL jar file WEB-INF/lib folder
  2. Included Classpath in Run Configuration (using Eclipse)
  3. 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屋!

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