@Value(value="${***.***}")配置文件赋值给static静态变量
public static String topicName; @Value("${activemq.topicName}") public void setTopicName(String topicName){ this.topicName = topicName; }
静态变量先声明后赋值,@Value注解写在set方法上
public static String topicName; @Value("${activemq.topicName}") public void setTopicName(String topicName){ this.topicName = topicName; }
静态变量先声明后赋值,@Value注解写在set方法上