你是在运行mastering EJB吧!
你的bean中的getproductID的方法名写成了getproductid。
你的bean中的getproductID的方法名写成了getproductid。
解决方案 »
- java 中的json 解码和编码问题
- Hibernate拆分多对多关系
- 【菜鸟求回答】一个关于16进制与char类型转换的问题。
- java-->struts-->jsp的form中输入冷僻中文简体汉字,进入action后从Actionform中取出的中文为乱玛问题,搜不到可行的解决方案,只能弱弱地再问一遍...
- 一个奇怪的问题
- hibernate 调用存储过程问题~~~急~~~
- 四个J2EE讨论群,都升级为256M高级群,分别讨论STRUTS EJB Servlet XML/JSP邀请各位豪杰加入,一起共享代码和教程
- ======请大家帮我出个主意!!!!!!!!
- struts裡驗證session怎樣做最方便??
- WEB后台Eclipse
- jmeter好像对内存检测无能为力
- 关于struts的问题
感觉没问题啊package examples;
import javax.ejb.*;
public abstract class ProductBean implements EntityBean {
protected EntityContext ctx; public ProductBean() {} public abstract String getName(); public abstract void setName(String name); public abstract String getDescription(); public abstract void setDescription(String description); public abstract String getProductID(); public abstract void setProductID(String productID); public abstract double getBasePrice(); public abstract void setBasePrice(double basePrice);
public void ejbActivate() {
System.out.println("ejbActivate() called.");
} public void ejbRemove() {
System.out.println("ejbRemove() called.");
} public void ejbPassivate() {
System.out.println("ejbPassivate() called.");
} public void ejbLoad() {
System.out.println("ejbLoad() called.");
} public void ejbStore() {
System.out.println("ejbStore() called.");
} public void setEntityContext(EntityContext ctx) {
System.out.println("setEntityContext called");
this.ctx = ctx;
} public void unsetEntityContext() {
System.out.println("unsetEntityContext called");
this.ctx = null;
} public void ejbPostCreate(String productID, String name, String description, double basePrice) {
System.out.println("ejbPostCreate() called");
} public ProductPK ejbCreate(String productID, String name, String description, double basePrice)
throws CreateException {
System.out.println("ejbCreate() called");
setProductID(productID);
setName(name);
setDescription(description);
setBasePrice(basePrice); return new ProductPK(productID);
}
}