Here, we are using @Autowired annotation to inject the environment object into our RestController , we can use it in Service class also.
User getProperty(String key) method to get a value for a specific property from application.properties.
Finally, we need to create a Web Service endpoint that accepts property key name as request parameter and returns property value.
0 Comments
Please Login to Comment Here