如下代码:学习环境为MyEclipse5.1+Eclipse3.2,运行其它标签都OK,但到XML标签时居然出错!
闷ing~~~,加载的JSTL为1.1版本,包JSTL.JAR,STANDARD.JAR两个包,网上有些人说再加入另外两个包,但怎么在MyEclipse中加入?
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml_rt" %>
<html>
<head>
<title>标签xml的使用</title>
</head>
<body>
<x:parse var="test">
<books>
<book id="01">
<name>JSP应用详解</name>
<price>99</price>
</book>
</books>
</x:parse>
<x:out select="$test/books//name"/><br>
<x:out select="$test//name"/><br>
<x:out select="$test/books/book/name"/><br>
<x:out select="$test/books/book/price"/><br>
</body>
</html>
页面出错提示如下:
org.apache.jasper.JasperException: Exception in JSP: /x_out.jsp:17
14: </book>
15: </books>
16: </x:parse>
17: <x:out select="$test/books//name"/><br>
18: <x:out select="$test//name"/><br>
19: <x:out select="$test/books/book/name"/><br>
20: <x:out select="$test/books/book/price"/><br>
TOMCAT中的错误提示如下:
2007-12-29 9:42:13 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet jsp threw exception
java.lang.NoClassDefFoundError: org/apache/xpath/XPathException
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)