读书人

ejb3对象导入struts后为空。解决思路

发布时间: 2012-03-17 19:06:28 作者: rapoo

ejb3对象导入struts后,为空。
public class NewVehicleAction extends ActionSupport{

private Vehicle vehicle;

@InjectEJB(name="grp/EntityInheritanceDAO")
private EntityInheritanceDAO entityInheritanceDAO;


public String execute() throws Exception{
//if (entityInheritanceDAO==null)
//return ERROR;
//else
entityInheritanceDAO.initializeDate(); /////////执行到此处,
/////////////////////////////////////////////////////////由于entityInheritanceDAO为空,所以报错
return SUCCESS;

.................下略

请问该如何办,注入的对象是不是怎样才不为空?

[解决办法]
别的代码和配置呢

读书人网 >J2EE开发

热点推荐