1
通过阅读本文,Spring 3 and JSR-330 @Inject and @Named example,建议在Spring 3之后使用JSR-330的标准注释。因此,应该使用@Named而不是@Component,@Repository和@Service。但是如何在Spring MVC中使用@Controller?我意识到@Controller也是一个@Component,并且在使用@Named时我在测试中得到了相同的结果。但我想确定我是否缺少任何东西。Spring 3和JSR-330注释
谢谢你的回应。但我的问题是,由于JSR-330,我们应该使用'@Named公共类MyDao',而不是'@Repository public class MyDao'。我想知道我们是否也应该将相同的规则应用于控制器类。 –