T
tomk4567
Newbie with JSP / JavaBeans.
Wondering where the compiled class code goes for a custom written Bean? I
placed the compiled Bean class in the JSP folder and the Servlet folder in
appropriate tomcat dir. But I am still getting a 'Unable to load class for
JSP' error from Apache.
When I use a standard java class such as java.util.Date there is no problem
getting the simple JSP to run correctly.
I am sure this is a simple question. Thanks for any help.
--
code:
Circle.class code (my simple Bean)
public class Circle {
double radius;
double area;
public void setRadius(double r) {
radius = r;
}
public double getRadius() {
return radius;
}
public void setArea(double a) {
area = a;
}
public double getArea() {
return area;
}
}
--
JSP code:
<html><head><title>
JSP calling a custom JavaBean
</title></head>
<body>
<center>
<jsp:useBean name="circle1" class="Circle" >
<jsp:setProperty name="circle1" property="radius" value="2">
Area = <jsp:getProperty name="circle1" property="area">
</center>
</body>
</html>
Wondering where the compiled class code goes for a custom written Bean? I
placed the compiled Bean class in the JSP folder and the Servlet folder in
appropriate tomcat dir. But I am still getting a 'Unable to load class for
JSP' error from Apache.
When I use a standard java class such as java.util.Date there is no problem
getting the simple JSP to run correctly.
I am sure this is a simple question. Thanks for any help.
--
code:
Circle.class code (my simple Bean)
public class Circle {
double radius;
double area;
public void setRadius(double r) {
radius = r;
}
public double getRadius() {
return radius;
}
public void setArea(double a) {
area = a;
}
public double getArea() {
return area;
}
}
--
JSP code:
<html><head><title>
JSP calling a custom JavaBean
</title></head>
<body>
<center>
<jsp:useBean name="circle1" class="Circle" >
<jsp:setProperty name="circle1" property="radius" value="2">
Area = <jsp:getProperty name="circle1" property="area">
</center>
</body>
</html>