Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • One time I want to use value from property, other time not - this is the cause of using this constructor. Please tell me why i don't see accurate value in the field? Commented Dec 18, 2018 at 13:13
  • If you have @Value in the attribute you won't see the injected value during constructor execution. This is so because Spring injects fields AFTER the constructor has finished executing. Commented Dec 18, 2018 at 13:26
  • After object returns from my constructor it still has this field setup to false Commented Dec 18, 2018 at 13:28
  • What's the content of your @Value(XXXX)? It should follow this format @Value("${name.of.a.property.from.application.yml}"), e.g: in application.yml: my-prop: "myvalue" -> @Value("${my-prop}") Commented Dec 18, 2018 at 13:31
  • i tried simple case like value from start true and even this does not work. Commented Dec 18, 2018 at 13:33