java – 可以在Spring中使用参数注入方法吗?
发布时间:2020-12-15 02:33:48 所属栏目:Java 来源:网络整理
导读:来自docs: In the client class containing the method to be injected (the CommandManager in this case),the method that is to be ‘injected’ must have a signature of the following form: public|protected [abstract] return-type theMethodName(
来自docs:
<public|protected> [abstract] <return-type> theMethodName(no-arguments); 是否存在解决此限制的方法? 解决方法
是的你可以.以下是春季文档
http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/beans.html的示例
@Autowired public void prepare(MovieCatalog movieCatalog,CustomerPreferenceDao customerPreferenceDao) { this.movieCatalog = movieCatalog; this.customerPreferenceDao = customerPreferenceDao; } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |