当前位置: 技术问答>java相关
为什么总是找不到bean?请进.....
来源: 互联网 发布时间:2015-04-18
本文导语: 环境: tomcat+win2000+ultraedit ------------------ tomcat的 server.xml配置 -------------------- showbean.jsp: ....... ..... -----------------------...
环境:
tomcat+win2000+ultraedit
------------------
tomcat的 server.xml配置
--------------------
showbean.jsp:
.......
.....
------------------------
将 mybean文件夹(里面包含Bean1.class)考到:d:jspapp
---------------------------
点击showbean.jsp
出现:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 9 in the jsp file: /showbean.jsp
Generated servlet error:
E:Apache Tomcat 4.0worklocalhost_showbean$jsp.java:60: 找不到类 mybean.Bean1。
mybean.Bean1 dialog = null;
^
An error occurred at line: 9 in the jsp file: /showbean.jsp
Generated servlet error:
E:Apache Tomcat 4.0worklocalhost_showbean$jsp.java:63: 找不到类 mybean.Bean1。
dialog= (mybean.Bean1)
^
An error occurred at line: 9 in the jsp file: /showbean.jsp
Generated servlet error:
E:Apache Tomcat 4.0worklocalhost_showbean$jsp.java:68: 找不到类 mybean.Bean1。
dialog = (mybean.Bean1) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "mybean.Bean1");
是否是路径问题 ^
tomcat+win2000+ultraedit
------------------
tomcat的 server.xml配置
--------------------
showbean.jsp:
.......
.....
------------------------
将 mybean文件夹(里面包含Bean1.class)考到:d:jspapp
---------------------------
点击showbean.jsp
出现:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 9 in the jsp file: /showbean.jsp
Generated servlet error:
E:Apache Tomcat 4.0worklocalhost_showbean$jsp.java:60: 找不到类 mybean.Bean1。
mybean.Bean1 dialog = null;
^
An error occurred at line: 9 in the jsp file: /showbean.jsp
Generated servlet error:
E:Apache Tomcat 4.0worklocalhost_showbean$jsp.java:63: 找不到类 mybean.Bean1。
dialog= (mybean.Bean1)
^
An error occurred at line: 9 in the jsp file: /showbean.jsp
Generated servlet error:
E:Apache Tomcat 4.0worklocalhost_showbean$jsp.java:68: 找不到类 mybean.Bean1。
dialog = (mybean.Bean1) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "mybean.Bean1");
是否是路径问题 ^
|
刚才笔误,应该是在d:jspapp下建一个WEB-INF目录,然后再建一个classes目录,再把mybean目录拷进去
|
改了以后再如mhow所说,建一个WEB-INF目录。