簡體   English   中英

Spring 3.2.9:支持有序自動連線集合

[英]Spring 3.2.9 : support for ordered autowired collections

Spring 4為有序自動接線收集提供支持。 我認為3.2.9沒有,即使它具有所有注釋。

有人可以確認這個假設嗎?

謝謝。

似乎3.2.9無法處理@Autowired集合的@Order,但是il通過@PostConstruct(或InitializingBean#afterPropertiesSet())方法實現此功能非常簡單:

Collections.sort(myCollection, AnnotationAwareOrderComparator.INSTANCE);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM