如何将这部分代码由struts1改为struts2实现

2025-03-12 20:24:49
推荐回答(2个)
回答1:

public class ProductTypeAction extends ActionSupport{
private ProductType productType ;
@Resource(name="productTypeServiceBean")
private ProductTypeService productTypeService;

public String getProductTypeById() throws Exception {
productType = productTypeService.find(ProductType.class, 3);
return "SUCCESS";
}
}
struts.xml


/text.jsp

回答2:


/WEB-INF/test.jsp