Closed. This question needs to be more focused。它当前不接受答案。
想改善这个问题吗?更新问题,使其仅通过editing this post专注于一个问题。
6年前关闭。
Improve this question
如何使用和
当使用
想改善这个问题吗?更新问题,使其仅通过editing this post专注于一个问题。
6年前关闭。
Improve this question
如何使用和
<context:component-scan base-package="x.y.z.controller" /> <mvc:annotation-driven/>?
执行Spring Injection当使用
<mvc:annotation-driven/>
时,我们不必为控制器指定bean,因此在使用<context:component-scan base-package="x.y.z.controller" />
时如何提供引用。 最佳答案
采用@Autowire
批注并在Application context.xml中定义
Here是一个示例。看一看
关于java - 带有注解的Spring Injection ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/18480240/