I have some @Value
annotation in spring-boot project. To Simplify, I have few classes: a restcontroller, service (annotated with @Service) and a pojo.
In each of these classes, I declared a variable as below:
@Value("${somevalue}")
private String somevalueVariable
- In the controller class, the value is getting populated as defined in the application.properties. So no problem here.
- In the service class, the value is showing up as null. This is my issue, how should i fix it to get the value from the application.properties
In the pojo, the value is showing up as null, I am thinking this is expected behaviour as spring does not manage this class.