通过application.properties配置SpringBoot项目
2024-09-27 06:21:21
application.properties可以自己新建,放在这里:(该文件可以放在4个地方,详情百度)
在文件中添加:file_path=E://Tools//apache-tomcat-9.0.1//webapps//AMPP//models//upload.stl
在controller(或其他需要的类)中引入import org.springframework.beans.factory.annotation.Value;
这样,即可使用配置文件中定义的值:
@Value("${file_path}")
private String template;
最新文章
- C#笔记
- Go语言实战 - revel框架教程之用户注册
- app开发遇到问题及解决
- 【Derby 系列】Apache Derby 功能特点
- Xcode 自定义代码段
- struts2视频学习笔记 11-12(动态方法调用,接收请求参数)
- Failed to create the java virtual machine完全解决办法
- Cannot find protocol declaration for ";XXDelegate"; 找不到协议错误
- POJ 3286 How many 0's?
- 信号量及PV原语
- Oracle EBS 预警系统管理
- Java中WebService实例
- Android实现先横向横线展现在纵向拉开图片
- ajax bookstrap美化网页,并实现页面的加载,删除与查看详情
- Amazing ASP.NET Core 2.0
- weui中的日期选择控件关于时间段的设置!
- 《你不知道的JavaScript上卷》知识点笔记
- U-boot-1.1.4中关于hello_world.srec出错
- 关于flex布局【转】
- .NET Standard 2.0正式发布了