首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

关于spring的空指针错误

2013-03-27 
关于spring的空指针异常这是我的applicationContext.xml的配置;bean idthemeDao refthemeDao/pro

关于spring的空指针异常
这是我的applicationContext.xml的配置;
<bean id="themeDao" ref="themeDao"></property>
</bean>
<bean id="themeAction" ref="themeService"></property>
</bean>

我的访问的ThemeAction大致代码如下:

public class ThemeAction extends ActionSupport {
private ThemeService themeService;

public ThemeService getThemeService() {
return themeService;
}

public void setThemeService(ThemeService themeService) {
this.themeService = themeService;
}



public String find() {
System.out.println(getThemeService() + "000000000000000");
//themes = themeService.findAll();
return NONE;
}
}


结果一访问这个action,发现themeService为null,它不是应该被spring自动注入的吗?

热点排行