spring在非controller裏使用service層的註解

       在SpringMVC框架中,經常要使用@Autowired註解注入Service接口,在controller層中注入service接口,在service層中注入其它的service接口或者mapper接口都是可以的,但是如果在自己封裝的Utils工具類中或者非controller普通類中使用@Autowired註解注入Service或者Mapper接口,直接注入是不可能的,因爲Uti
相關文章
相關標籤/搜索