I have an annotated bean with @Component
that gets built using <context:component-scan/>
, however I wish to set a boolean property after this has been created from a value within a properties file using <context:property-placeholder/>
.
Asked
Active
Viewed 2,013 times
0

Brett Ryan
- 26,937
- 30
- 128
- 163
-
3Annotate the field with `@Value("propertyName")`. See this answer: http://stackoverflow.com/questions/11890544/spring-value-annotation-in-controller-class-not-evaluating-to-value-inside-pro – Sotirios Delimanolis Apr 03 '13 at 16:48
-
Thanks @SotiriosDelimanolis. Please make an answer and I shall accept it. – Brett Ryan Apr 03 '13 at 17:11
-
Too late :). Happy you got it. – Sotirios Delimanolis Apr 03 '13 at 17:41
-
1LOL no that's not what I was getting at. Give him the answer, I don't care about points as long as you solved your problem. – Sotirios Delimanolis Apr 03 '13 at 17:49
-
@SotiriosDelimanolis if you add an answer, I will delete mine. you did answer first after all. I just wanted the question to show up as having been answered in the search. – Rylander Apr 03 '13 at 17:52
1 Answers
2
Annotate the field with @Value("propertyName")
.
See related question: Spring @Value annotation in @Controller class not evaluating to value inside properties file