Friday, January 2, 2015

Spring MVC read properties in the class

This is sample code:

@Component( "emailService" )
public class EmailService {

  @Value( "${mail.server.url}" )
  private String url;

....
}

in the property file
mail.server.ur=http://abc/def


No comments:

Post a Comment