关于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自动注入的吗?