79106356

Date: 2024-10-20 04:26:06
Score: 3
Natty:
Report link

is this fine Best way to read properties in Spring Boot is by using the @Value annotation for individual properties or by binding them to a configuration class using @ConfigurationProperties. This allows for easy injection of property values from application.properties or application.yml into your components, services, or beans.

@Value("${creds}") private String creds;

in application file define creds=32432432432

it will pick value 324324324

Reasons:
  • No code block (0.5):
  • User mentioned (1): @Value
  • User mentioned (0): @ConfigurationProperties
  • Starts with a question (0.5): is this
  • Low reputation (1):
Posted by: Yash