*****用记事本写的第一个jsp调用bean就出错,望求前辈帮忙》》》》》》》》》
jsp页面代码:
<jsp:useBean id= "hy " scope= "page " class= "com.wdj.Test "/>
<%=hy.getS()%>
bean代码:
package com.wdj;
public class Test{
public String getS(){
return "asdfasdfas ";
}
}
存放的路径是:C:\Tomcat 5.5\webapps\My\classes\com\wdj\Test.class
运行时出现:
org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.servlet.JspServletWrapper.handle
JspException(JspServletWrapper.java:512)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
代码源码地址:http://www.yeesion.com/src/My.rar
------解决方案--------------------C:\Tomcat 5.5\webapps\My\WEB-INF\classes\com\wdj\Test.class
在My目录下建WEB-INF目录,这个可以到webapps\ROOT下拷贝