Dev/Java
[Spring] properties, @Value
냐옴
2019. 6. 21. 14:04
my-prop.properties
prop.key1 = 123 |
servlet.xml
<beans <util:properties id="myProp" location="classpath:properties/my-pop.properties"/> </beans> |
controller
@Value("#{myProp['prop.key1']}") private String myValue1; @Value("#{'true'.equals(myProp['prop.key2'])}") private boolean myValue2; |