当前位置: 技术问答>java相关
JSP中使用CLASS总抱错!!!(各位大虾救救我)
来源: 互联网 发布时间:2015-09-07
本文导语: org.apache.jasper.JasperException: Unable to compile class for JSP 其实,我的类文件,包括包都存在,可是TOMCAT总是报错!! 各位大虾救救我,不然,我就寸步难行了啊! An error occurred at line: 3 in the jsp file: /index.jsp Gen...
org.apache.jasper.JasperException: Unable to compile class for JSP
其实,我的类文件,包括包都存在,可是TOMCAT总是报错!!
各位大虾救救我,不然,我就寸步难行了啊!
An error occurred at line: 3 in the jsp file: /index.jsp
Generated servlet error:
C:Apache Tomcat 4.0workStandalonelocalhost_index$jsp.java:73: 找不到类 org.newth.web.notepad.PadInfo。
org.newth.web.notepad.PadInfo info = null;
^
An error occurred at line: 3 in the jsp file: /index.jsp
Generated servlet error:
C:Apache Tomcat 4.0workStandalonelocalhost_index$jsp.java:76: 找不到类 org.newth.web.notepad.PadInfo。
info= (org.newth.web.notepad.PadInfo)
^
An error occurred at line: 3 in the jsp file: /index.jsp
Generated servlet error:
C:Apache Tomcat 4.0workStandalonelocalhost_index$jsp.java:81: 找不到类 org.newth.web.notepad.PadInfo。
info = (org.newth.web.notepad.PadInfo) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "org.newth.web.notepad.PadInfo");
^
An error occurred at line: 5 in the jsp file: /index.jsp
Generated servlet error:
C:Apache Tomcat 4.0workStandalonelocalhost_index$jsp.java:107: 找不到类 org.newth.web.notepad.PadList。
org.newth.web.notepad.PadList padlist = null;
^
An error occurred at line: 5 in the jsp file: /index.jsp
Generated servlet error:
C:Apache Tomcat 4.0workStandalonelocalhost_index$jsp.java:110: 找不到类 org.newth.web.notepad.PadList。
padlist= (org.newth.web.notepad.PadList)
^
An error occurred at line: 5 in the jsp file: /index.jsp
Generated servlet error:
C:Apache Tomcat 4.0workStandalonelocalhost_index$jsp.java:115: 找不到类 org.newth.web.notepad.PadList。
padlist = (org.newth.web.notepad.PadList) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "org.newth.web.notepad.PadList");
^
6 个错误
其实,我的类文件,包括包都存在,可是TOMCAT总是报错!!
各位大虾救救我,不然,我就寸步难行了啊!
An error occurred at line: 3 in the jsp file: /index.jsp
Generated servlet error:
C:Apache Tomcat 4.0workStandalonelocalhost_index$jsp.java:73: 找不到类 org.newth.web.notepad.PadInfo。
org.newth.web.notepad.PadInfo info = null;
^
An error occurred at line: 3 in the jsp file: /index.jsp
Generated servlet error:
C:Apache Tomcat 4.0workStandalonelocalhost_index$jsp.java:76: 找不到类 org.newth.web.notepad.PadInfo。
info= (org.newth.web.notepad.PadInfo)
^
An error occurred at line: 3 in the jsp file: /index.jsp
Generated servlet error:
C:Apache Tomcat 4.0workStandalonelocalhost_index$jsp.java:81: 找不到类 org.newth.web.notepad.PadInfo。
info = (org.newth.web.notepad.PadInfo) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "org.newth.web.notepad.PadInfo");
^
An error occurred at line: 5 in the jsp file: /index.jsp
Generated servlet error:
C:Apache Tomcat 4.0workStandalonelocalhost_index$jsp.java:107: 找不到类 org.newth.web.notepad.PadList。
org.newth.web.notepad.PadList padlist = null;
^
An error occurred at line: 5 in the jsp file: /index.jsp
Generated servlet error:
C:Apache Tomcat 4.0workStandalonelocalhost_index$jsp.java:110: 找不到类 org.newth.web.notepad.PadList。
padlist= (org.newth.web.notepad.PadList)
^
An error occurred at line: 5 in the jsp file: /index.jsp
Generated servlet error:
C:Apache Tomcat 4.0workStandalonelocalhost_index$jsp.java:115: 找不到类 org.newth.web.notepad.PadList。
padlist = (org.newth.web.notepad.PadList) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "org.newth.web.notepad.PadList");
^
6 个错误
|
把你的class文件放到WEB-INFclasses 注意包名与目录名对应:
比如你的org.newth.web.notepad.PadList 包,你就要把PadList.class放到
WEB-INFclassesorgnewthwebnotepadPadList.class
或者把所有的class打包生成.jar放到 WEB-INFlib注意路径也要对应
比如你的org.newth.web.notepad.PadList 包,你就要把PadList.class放到
WEB-INFclassesorgnewthwebnotepadPadList.class
或者把所有的class打包生成.jar放到 WEB-INFlib注意路径也要对应
|
试一试在classpath中指定包的位置。
|
其实,我的类文件,包括包都存在,可是TOMCAT总是报错!!
你在project->project properties->required Libraries中新加个资源,将他指到这些类文件和包上。
你在project->project properties->required Libraries中新加个资源,将他指到这些类文件和包上。