设为首页 加入收藏

TOP

Spring Boot 的配置文件详解(二)
2018-10-14 22:08:17 】 浏览:356
Tags:Spring Boot 配置 文件 详解

    }
    public void setPort(int port) {
        this.port = port;
    }
    public String getContextPath() {
        return contextPath;
    }
    public void setContextPath(String contextPath) {
        this.contextPath = contextPath;
    }
}


可以使用 @Autowired 直接注入该配置类,还可以指定 properties 文件位置。
@Autowired
private ServerConfig serverConfig;


@ConfigurationProperties(prefix = "server", locations = {"classpath:config/author.properties"});


首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇如何在Linux中编写和运行C程序 下一篇TypeScript 3.1增加可映射元组和..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目