PHPz2017-04-18 10:46:01
No need for get set method
@Value("#{propertiesReader}")
public Properties props;
@Value("#{propertiesReader['username']}")
public String username;
PHP中文网2017-04-18 10:46:01
Since you want to inject the entire properties, you should write:
@Value("#{propertiesReader}")
public void setProps(Properties props) {
this.props = props;
}
instead of
@Value("#{propertiesReader[username]}")