首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

spring中autowired引文

2013-08-01 
spring中autowired注解当执行这个action的时候,这个Test3怎么也注入不进来,这个Test3在spring容器初始化的

spring中autowired注解
spring中autowired引文spring中autowired引文spring中autowired引文
当执行这个action的时候,这个Test3怎么也注入不进来,这个Test3在spring容器初始化的时候已经初始化了
[解决办法]
Test3 应该使用注解@Component
[解决办法]
按理说没问题阿.....你的action是怎么生成的?也是Spring托管的么?
[解决办法]
@Service("test3")
[解决办法]
你试试手动写个<bean> 这个肯定可以的
然后你看看你注入的bean在不在你列出的扫描包内。
3楼的也试试,把Autowired 换成 Resource 试试。

热点排行