package sale;
public class goodsbean{
String Product;
double Price;
public goodsbean (){
this.Product = "box";
this.Price = 5.0;
}
public void setProduct (String ProductName){
this.Product = ProductName;
}
public String getProduct(){
return (this.Product);
}
public void setPrice (double priceValue){
this.Price = priceValue;
}
public double getPrice(){
return (this.Price);
}
}
编译完生成的.class文件,放到:Tomcat 5.5\webapps\ROOT\WEB-INF\classes\sale 目录下。
调用方法:
goodsbeangoodsbean.setProduct("clock");
goodsbean.setPrice(17);
%>
使用方法1:
产品:
税率:
goodsbean.setPrice(3);
%>
使用方法2:
产品:
税率: