displayproductaction.java
来自「基于Struts的网络商店源码。使用Hibernate技术」· Java 代码 · 共 84 行
JAVA
84 行
package com.sush.webstore.store.web.struts;
import com.sush.webstore.store.domain.IProduct;
import com.sush.webstore.store.domain.IWebStoreFacade;
import com.sush.webstore.store.domain.facade.WebStorePOJO;
public class DisplayProductAction {
private long id;
private IProduct product;
private Integer itemCount;
private IWebStoreFacade webStore = new WebStorePOJO();
public String execute() {
product = webStore.getProduct(id);
itemCount = webStore.getItemsCount(product);
return (product == null) ? "error" : "success";
}
/**
* @return the id
*/
public long getId() {
return id;
}
/**
* @param id
* the id to set
*/
public void setId(long id) {
this.id = id;
}
/**
* @return the product
*/
public IProduct getProduct() {
return product;
}
/**
* @param product
* the product to set
*/
public void setProduct(IProduct product) {
this.product = product;
}
/**
* @return the webStore
*/
public IWebStoreFacade getWebStore() {
return webStore;
}
/**
* @param webStore
* the webStore to set
*/
public void setWebStore(IWebStoreFacade webStore) {
this.webStore = webStore;
}
/**
* @return the itemCount
*/
public Integer getItemCount() {
return itemCount;
}
/**
* @param itemCount
* the itemCount to set
*/
public void setItemCount(Integer itemCount) {
this.itemCount = itemCount;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?