如何在jsp裡使用dom4j包
最近在學xml,我寫了個讀取xml內容的jsp程序,運行的時候tomcat提醒如下:
-----------------------------------------
org.apache.jasper.JasperException: Unable to compile class for JSP
Generated servlet error:
C:\Tomcat 5.0\work\Catalina\localhost\web_jdbc\org\apache\jsp\create_005fxml_jsp.java:6: package org.dom4j does not exist
import org.dom4j.Document;
Generated servlet error:
C:\Tomcat 5.0\work\Catalina\localhost\web_jdbc\org\apache\jsp\create_005fxml_jsp.java:7: package org.dom4j does not exist
import org.dom4j.DocumentHelper;
.................
----------------------------------------------
我看了一下頭 <%@ pageimport= "org.dom4j.Document,org.dom4j.DocumentHelper "%>
dom4j的類包也放在了lib目錄下,tomcat也重起過了,為什麼還是出現上面那樣的錯誤呢?
^
------解决方案--------------------试一下这个 <%@ page import= "org.dom4j.Document,org.dom4j.DocumentHelper "%>
就是在page和import中间加一个空格
------解决方案-------------------- <%@ page import= "org.dom4j.Document,org.dom4j.DocumentHelper "%>
我的异常网推荐解决方案:org.apache.jasper.JasperException: Unable to compile class,http://www.aiyiweb.com/j2ee/2308.html