Works in SpringBoot Only
Check Following properties file
#Simple properties
mail.hostname=host@mail.com
mail.port=9000
mail.from=mailer@mail.com
Properties file directly mapped to Class Fields
Use @ConfigurationProperties
@ConfigurationProperties(prefix = "mail")
public class ConfigProperties {
private String hostName;
private int port;
private String from;
// standard getters and setters
}
org.springframework.boot.context.properties.ConfigurationProperties;
No comments:
Post a Comment