SpringMvc 在非Controller下使用@Autowired
在SpringMVC框架中,我们经常要使用@Autowired注解注入Service或者Mapper接口,我们也知道,在Controller层中注入service接口,在service层中注入其它的service接口或者mapper接口都是可以的,但是如果我们要在我们自己封装的一些类中或者说非controller普通类中使用@Autowired注解注入Service或者Mapper接口,直接注入是肯
原创
2017-12-05 17:06:07 ·
2027 阅读 ·
1 评论