3
我想使用SPEL使用上ApplicationContext的
@Value
精確地提取從應用程序上下文的一些數據執行SPEL,我想這個代碼值
@Autowired
private ApplicationContext context;
Map<String, CrudRepository> repos =
context.getBeansOfType(CrudRepository.class);
@Value("#{...})
private Map<String, CrudRepository> repos;
是有魔力像我可以調用的「systemProperties」變量?必須有!
你的意思是我可以自動裝載我想要的東西?讓我試試 –
WOW DUDE!你可以自動裝配!我不知道!我可以給你2票嗎? 1爲回答這個問題,另一個爲了告訴我爲什麼這完全沒有必要? –
:-)。那麼,你可以投票給我許多其他的答案。是的,我很高興這很有幫助。 –