Hi Guys,
I have installed Wrox web application under /usr/local/tomcat5/webapps/wrox
I can't fix the JavaBean I created under
/usr/local/tomcat5/webapps/wrox/chp4/Reuse/WEB-INF/classes/com/wrox/cars/CarBean.class
CarBean.java
======================================================
package com.wrox.cars;
import java.io.Serializable;
public class CarBean implements Serializable {
private String make = "Ford";
private double cost = 10000.00;
private double taxRate = 17.5;
public CarBean(){
}
public String getMake() {
return make;
}
public void setMake(String make) {
this.make = make;
}
public double getPrice() {
double price = (cost + (cost * (taxRate/100)));
return price;
}
}
======================================================
I created
/usr/local/tomcat5/webapps/wrox/chp4/Reuse/carPage.jsp
======================================================
<html>
<head>
<title>Using a JavaBean</title>
</head>
<body>
<h2>Using a JavaBean</h2>
<jsp:useBean id="myCar" class="com.wrox.cars.CarBean" />
I have a <jsp:getProperty name="myCar" property="make" /> <br />
<jsp:setProperty name="myCar" property="make" value="Ferrari" />
Now I have a <jsp:getProperty name="myCar" property="make" />
</body>
</html>
======================================================
But Tomcat return
exception
org.apache.jasper.JasperException: com.wrox.cars.CarBean
root caused
java.lang.ClassNotFoundException: com.wrox.cars.CarBean
when I tried to display carPage.jsp
Pls help !!
I have installed Wrox web application under /usr/local/tomcat5/webapps/wrox
I can't fix the JavaBean I created under
/usr/local/tomcat5/webapps/wrox/chp4/Reuse/WEB-INF/classes/com/wrox/cars/CarBean.class
CarBean.java
======================================================
package com.wrox.cars;
import java.io.Serializable;
public class CarBean implements Serializable {
private String make = "Ford";
private double cost = 10000.00;
private double taxRate = 17.5;
public CarBean(){
}
public String getMake() {
return make;
}
public void setMake(String make) {
this.make = make;
}
public double getPrice() {
double price = (cost + (cost * (taxRate/100)));
return price;
}
}
======================================================
I created
/usr/local/tomcat5/webapps/wrox/chp4/Reuse/carPage.jsp
======================================================
<html>
<head>
<title>Using a JavaBean</title>
</head>
<body>
<h2>Using a JavaBean</h2>
<jsp:useBean id="myCar" class="com.wrox.cars.CarBean" />
I have a <jsp:getProperty name="myCar" property="make" /> <br />
<jsp:setProperty name="myCar" property="make" value="Ferrari" />
Now I have a <jsp:getProperty name="myCar" property="make" />
</body>
</html>
======================================================
But Tomcat return
exception
org.apache.jasper.JasperException: com.wrox.cars.CarBean
root caused
java.lang.ClassNotFoundException: com.wrox.cars.CarBean
when I tried to display carPage.jsp
Pls help !!
