tomcat下是应该把自己编写的类放在web-inf/classes中吧,为什么却提示说找不到类呢?
org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 33 in the jsp file: /search.jsp
EngCLIR2 cannot be resolved to a type
30:     Analyzer analyzer = null;
31:             
32:     if(lang.equals("En")){
33:         EngCLIR2 engclir = new EngCLIR2();
34:         engclir.setQuery(sEng);
35:         hits = engclir.search("C:\\tomcat\\Tomcat 5.0\\webapps\\clir\\NTCIR3ChnIndex");
36:         destquery = engclir.destquery;
An error occurred at line: 33 in the jsp file: /search.jsp
EngCLIR2 cannot be resolved to a type
30:     Analyzer analyzer = null;
31:             
32:     if(lang.equals("En")){
33:         EngCLIR2 engclir = new EngCLIR2();
34:         engclir.setQuery(sEng);
35:         hits = engclir.search("C:\\tomcat\\Tomcat 5.0\\webapps\\clir\\NTCIR3ChnIndex");
36:         destquery = engclir.destquery;
An error occurred at line: 38 in the jsp file: /search.jsp
ChnAnalyzer cannot be resolved to a type
35:         hits = engclir.search("C:\\tomcat\\Tomcat 5.0\\webapps\\clir\\NTCIR3ChnIndex");
36:         destquery = engclir.destquery;
37:         query = engclir.query;
38:         analyzer = new ChnAnalyzer();
39:         if(hits != null)
40:             System.out.println("jieguowei"+hits.length());
41:     }
An error occurred at line: 44 in the jsp file: /search.jsp
LuceneQuery cannot be resolved to a type
41:     }
42:     
43:     if(lang.equals("Ch")){
44:       LuceneQuery lq = new LuceneQuery("chn");
45:  lq.search(sEng);
46:  hits = lq.hits;
47:  destquery = sEng;
An error occurred at line: 44 in the jsp file: /search.jsp
LuceneQuery cannot be resolved to a type
41:     }
42:     
43:     if(lang.equals("Ch")){
44:       LuceneQuery lq = new LuceneQuery("chn");
45:  lq.search(sEng);
46:  hits = lq.hits;
47:  destquery = sEng;
An error occurred at line: 49 in the jsp file: /search.jsp
ChnAnalyzer cannot be resolved to a type
46:  hits = lq.hits;
47:  destquery = sEng;
48:  query = lq.query;
49:  analyzer = new ChnAnalyzer();
50: 
51:     }
52:     
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:93)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:319)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
急需解决,在线等哦!

解决方案 »

  1.   

    是把.class文件放到WEB-INF/classes目录下,问题就是找不到这几个类的.class文件,所以报cannot be resolved to a type 错误
      

  2.   

    是没有找到class的,但是应该怎么弄呢?
      

  3.   

    JSP页面要引入你用到的类..
    <%@ page contentType="text/html; charset=gb2312" import="java.util.*,java.sql.*"%>
    引入的类文件写在import=""里,引入多个类用逗号隔开.
      

  4.   

    我引入了呀
    <%@ page import="analyzer.*"%>
    <%@ page import="org.apache.lucene.analysis.*"%>
    <%@ page import="org.apache.lucene.queryParser.*"%>
    <%@ page import="org.apache.lucene.search.*"%>
    <%@ page import="org.apache.lucene.document.*"%>
    <%@ page import="org.apache.lucene.analysis.standard.*"%>
    <%@ page import="Search.*"%>
    <%@ page import="java.util.*"%>
    <%@ page import="org.apache.lucene.search.highlight.*"%>
      

  5.   

    你把项目中用到的jar包放到WEB-INF\lib目录下,你再试试看
      

  6.   

    检查一下你的WEB-INF是大写还是小写?  必须是大写的
    +webroot
    ----WEB-INF
    --------classes
    --------lib
      

  7.   

    检查一下你自己编写的类放在哪里,路径是否和你引入的路径一样..你用什么工具编写的jsp?如果是用MyEclipse,应该会有错误提示的..