最近在使用Springmvc,由于要使用注解@AutoWired,所以在springmvc的配置文件中,加入了下面这两行代码:
,在spring的配置文件中,配置dao包。
在controlle中,无法使用@Autowired,无法注入,报Null的异常,我的解决办法是:将springmvc的配置文件中的启动注解<context:annotation-config></context:annotation-config>去掉就可以了。
最近在使用Springmvc,由于要使用注解@AutoWired,所以在springmvc的配置文件中,加入了下面这两行代码:
,在spring的配置文件中,配置dao包。
在controlle中,无法使用@Autowired,无法注入,报Null的异常,我的解决办法是:将springmvc的配置文件中的启动注解<context:annotation-config></context:annotation-config>去掉就可以了。