TagLibraryValidato未找到

hamu 08-05-29

编写了一个简单的jstl的例子,怎么总是报错说是java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagLibraryValidator.到底怎么解决啊。我用的是myeclipse.
下面是我的源代码:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>

<body>
<c:out value="Hello, World"/>
</body>
</html>

hamu
2008-05-30 22:16

有知道的吗,困扰了好长时间啊

banq
2008-06-02 10:56

>java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagLibraryValidator.
说明这个类没有,在google中键入这个类全名,得到jar包,下载到你的classpath中就可以,这好像是servlet的一个基本包中的。