连接java beans不成功,java和tomcat环境已经配好了呀
这是java beans文件,已经编译通过,放在了C:\Tomcat\common\classes\abc目录下:
import java.io.*;
public class circle{
int radius;
public circle(){
radius=1;
}
public int getradius(){
return radius;
}
public void setradius(int newradius){
radius=newradius;
}
public double circlearea(){
return Math.PI*radius*radius;
}
public double circlelength(){
return 2.0*Math.PI*radius;
}
}
下面是jsp文件:
<%@ page contenttype= "text/html;charset=gb2312 " %>
<%@ page import= "abc.circle " %>
<html>
<body bgcolor=cyan>
<font size=1>
<jsp:usebean id= "girl " class= "abc.circle " scope= "page ">
</jsp:usebean>
<% girl.setradius(100);
%>
<p> 圆的半径是:
<%= girl.getradius() %>
<p> 圆的周长是:
<%= girl.circlelength() %>
<p> 圆的面积是:
<%= girl.circlearea() %>
</font>
</body>
</html>
运行后,提示错误如下:
HTTP Status 500 -
--------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: /usebeans.jsp(6,5) Invalid standard action
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88)
org.apache.jasper.compiler.Parser.parseStandardAction(Parser.java:1259)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1577)
org.apache.jasper.compiler.Parser.parse(Parser.java:127)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:212)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:156)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:296)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:299)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
note The full stack trace of the root cause is available in the Apache &nb