Java – can I use parameter injection methods in spring?

From docs:

<public|protected> [abstract] <return-type> theMethodName(no-arguments);

Is there a solution to this limitation?

Solution

Yes, you can The following is the spring documentation http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/beans.html Examples of

@Autowired
 public void prepare(MovieCatalog movieCatalog,CustomerPreferenceDao customerPreferenceDao) {
   this.movieCatalog = movieCatalog;
   this.customerPreferenceDao = customerPreferenceDao;
 }
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>