开发者

How to address properties with "." in the key name in spring 3.0 @Value tag

开发者 https://www.devze.com 2022-12-14 13:43 出处:网络
@Value(\"#{myProperties.prop_part1_part2}\") works but @Value(\"#{myProperties.prop.part1.part2}\") 开发者_如何学Go
@Value("#{myProperties.prop_part1_part2}")

works but

@Value("#{myProperties.prop.part1.part2}")
开发者_如何学Go

Doesn't.

How do I address a property with "." in the key ?


I haven't used spring 3 yet, so my answer is a shot in the dark. Try

@Value("#{myProperties['prop.part1.part2']"}
0

精彩评论

暂无评论...
验证码 换一张
取 消