Home > front end >  The value for The useBean class attribute Tom. Jiafei. The Circle is invalid.
The value for The useBean class attribute Tom. Jiafei. The Circle is invalid.

Time:09-19

My JSP file: example4_1 JSP
<% @ page contentType="text/HTML. Charset=GB2312 "% & gt;
<body bgcolor=cyan>

Round the initial radius is: & lt; %=circle. The getRadius () % & gt;
<% double newRadius=100;
Circle. SetRadius (newRadius);
%>

Modify the radius for & lt; % %=newRadius & gt;

Circle radius is at present: & lt; %=circle. The getRadius () % & gt;

The circumference of the circle is: & lt; %=circle. The circleLength () % & gt;

The area of a circle is: & lt; %=circle. The circleArea () % & gt;



Javabeans files:
Circle. Ava:
Package Tom. Jiafei;
Public class Circle {
Double radius;
Public Circle () {
The radius=1;
}
Public double getRadius () {
Return the radius.
}
Public void setRadius (double newRadius) {
The radius=newRadius;
}
Public double circleArea () {
Return Math. Radius, PI * * radius;
}
Public double circleLength () {
Return 2.0 * Math. PI * radius;
}
}

Then an error, baidu still cannot solve the many methods, seek help from a great god




The exception

Org. Apache. Jasper. JasperException:/ch4/example4_1 JSP (line: 3, column: 4) The value for The useBean class attribute Tom. Jiafei. The Circle is invalid.
Org.apache.jasper.com piler. DefaultErrorHandler. JspError (DefaultErrorHandler. Java: 41)
Org.apache.jasper.com piler. ErrorDispatcher. Dispatch (ErrorDispatcher. Java: 291)
Org.apache.jasper.com piler. ErrorDispatcher. JspError (ErrorDispatcher. Java: 114)
Org.apache.jasper.com piler. The Generator $GenerateVisitor. Visit (1379). The Generator Java:
Org.apache.jasper.com piler. Node $UseBean. Accept (1187) Node. Java:
Org.apache.jasper.com piler. Node $Nodes. Visit (2392) Node. Java:
Org.apache.jasper.com piler. Node $Visitor. VisitBody (2444) Node. Java:
Org.apache.jasper.com piler. Node $Visitor. Visit (2450) Node. Java:
Org.apache.jasper.com piler. $Root Node. The accept (471) Node. Java:
Org.apache.jasper.com piler. Node $Nodes. Visit (2392) Node. Java:
Org.apache.jasper.com piler. The Generator. The generate (3668). The Generator Java:
Org.apache.jasper.compiler.Com piler. GenerateJava (Compiler. Java: 252)
Org.apache.jasper.compiler.Compiler.com running (372) Compiler. Java:
Org.apache.jasper.compiler.Compiler.com running (349) Compiler. Java:
Org.apache.jasper.compiler.Compiler.com running (333) Compiler. Java:
Org.apache.jasper.JspCompilationContext.com from running (JspCompilationContext. Java: 600)
Org. Apache. Jasper. Servlet. JspServletWrapper. Service (368) JspServletWrapper. Java:
Org. Apache. Jasper. Servlet. JspServlet. ServiceJspFile (JspServlet. Java: 385)
Org. Apache. Jasper. Servlet. JspServlet. Service (329) JspServlet. Java:
Javax.mail. Servlet. HTTP. HttpServlet. Service (HttpServlet. Java: 729)
Org, apache tomcat, websocket server. WsFilter. DoFilter (WsFilter. Java: 52)
Note The full stack trace of The root cause is available in The Apache Tomcat/8.5.11 logs.

CodePudding user response:

Don't use a virtual directory, virtual directory can not find. Class files

CodePudding user response:

Your Circle. Java file is not compiled into bytecode file (class), have Circle in classes directory. The Java bytecode file
  • Related