请帮忙看看这个错误,先谢谢了。。。。。。。。。。。。。
我在CLASSPATH中加入了e:\jspnet\tomcat\webapps\examples\jsp\,在E:\jspnet\tomcat\webapps\examples\jsp\my有一个helloWorld.class,我用一个JSP文件连接这个class,但是出现错误:
Error: 500
Location: /examples/jsp/1.jsp
Internal Servlet Error:
org.apache.jasper.JasperException: Unable to compile Note: sun.tools.javac.Main has been deprecated.
E:\jspnet\tomcat\work\DEFAULT\examples\jsp\_1_1.java:80: Class my.helloWorld not found.
my.helloWorld helloBean = null;
^
E:\jspnet\tomcat\work\DEFAULT\examples\jsp\_1_1.java:83: Class my.helloWorld not found.
helloBean= (my.helloWorld)
^
E:\jspnet\tomcat\work\DEFAULT\examples\jsp\_1_1.java:88: Class my.helloWorld not found.
helloBean = (my.helloWorld) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "my.helloWorld");
^
3 errors, 1 warning
两个文件为:
//helloWorld.java
package my;
public class helloWorld {
public String name = "My first bean";
public String getHi()
{
return "Hello from " + name;
}
}
//1.jsp
<html>
<head>
<title>Hi-JSP实验</title>
</head>
<body>
<%@ include file="index.html" %>
<%
String Msg =new String("Hi-JSP实验.");
out.print("Hi-JSP实验");
%>
<h2><%=Msg%></h2>
<jsp:useBean id="helloBean" scope="session" class="my.helloWorld" />
<%= helloBean.getHi() %>
</body>
</html>