頁面頂部引入了:<%@ page import = " javax.servlet.*, javax.servlet.http.*, java.io.*, org.apache.lucene.analysis.*, org.apache.lucene.analysis.standard.StandardAnalyzer, org.apache.lucene.document.*, org.apache.lucene.index.*, org.apache.lucene.store.*, org.apache.lucene.search.*, org.apache.lucene.search.highlight.*, org.apache.lucene.queryParser.*, org.apache.lucene.demo.*, org.apache.lucene.demo.html.Entities, java.net.URLEncoder, org.apache.lucene.util.Version" %>==================================定義:Highlighter hl;//或者org.apache.lucene.search.highlight.Highlighter hl;==================================報(bào)錯(cuò):org.apache.jasper.JasperException: Unable to compile class for JSP:An error occurred at line: 97 in the jsp file: /results.jsporg.apache.lucene.search.highlight.Highlighter cannot be resolved to a type仍然不行啊。
1 回答

手掌心
TA貢獻(xiàn)1942條經(jīng)驗(yàn) 獲得超3個(gè)贊
這個(gè)包不包括在lucene核心包lucene-core.jar里,你要下載全包,然后在contrib\highlighter找到這個(gè)包加上去,既然你把這些代碼放到web上去,你要把這個(gè)包放到tomcat下這個(gè)項(xiàng)目當(dāng)中,別把它放到eclipse下classpath,web項(xiàng)目是要部署到tomcat上去,如果不放到tomcat上當(dāng)然找不到這個(gè)包。最好寫代碼把邏輯代碼放到.java文件上,只要把結(jié)果放到web頁面就好了,免得調(diào)試麻煩,再弄不好Hi我吧
- 1 回答
- 0 關(guān)注
- 1188 瀏覽
添加回答
舉報(bào)
0/150
提交
取消