InterviewSolution
| 1. |
What is Spring Application Properties and how it is used? |
|
Answer» Spring Boot LETS us define Application Properties to support us for work in different environments. These properties include parameters like application name, server port number, data source details, PROFILES, and many other useful properties. Spring Boot supports YAML based properties configurations to RUN the application. We can simply put an “application.yml” file in “src/main/resources” directory, and it will be auto-detected. So, by using this default file, we don’t NEED to explicitly register a PropertySource, or provide a PATH to a property file, unlike native Spring where we have explicitly define them. A sample application.yml file looks like below: spring: application: name: SampleRestService profiles: active: prod server.port = 9090 |
|