排序
Spring Boot获取yml文件配置注入Map/List/String等类型
在Java类中,如何获取application.yml的配置内容呢?具体实现如下: 前提 用到的yml文件有application.yml、application-access-dev.yml、application-access-devSjzd.yml,其中application.yml...
Spring Boot注解@PostConstruct含义
Spring Boot项目中使用@PostConstruct注解的作用是什么呢? 参考: 注解@PostConstruct与@PreDestroy详解及实例 @PostConstruct Why use @PostConstruct?
Spring Boot如何获取HTTP请求头
获取单个Header 示例: @PostMapping(value = '/tree') public String organTree(@RequestHeader('appKey') String appKey) { return ''; } 获取所有Header 示例: @GetMapping('/listHeaders')...
Spring Boot读取jar包文件错误解决
从jar包中读取classpath下文件出错: java.io.FileNotFoundException: class path resource [conf/sendofd.xml] cannot be resolved to absolute file path because it does not reside in the ...
IntelliJ IDEA配置实现SpringBoot项目热部署的最简单方式
这里整理了几种IntelliJ IDEA配置实现SpringBoot项目热部署的方式,其中使用jrebel应该是最简单的方式,而且没有后遗症: 环境: IntelliJ IDEA 2018.3; Jrebel 2018.1.7; 方式一 1.安装jrebe...
SpringBoot实现FTP文件下载及预览功能
SpringBoot将文件上传到FTP之后,后续的在前端进行文件的下载及预览实现方式如下: 前端代码 // 根据文件路径和文件名进行下载 function downLoadFile(filePath, fileName) { // 后台获取文件 v...
Spring Boot常用注解
1.@SpringBootApplication @SpringBootApplication注解等价于以默认属性使用@Configuration, @EnableAutoConfiguration 和 @ComponentScan 。 官方文档:Using the @SpringBootApplication Ann...
Spring判断当前连接的数据库类型
Java代码获取当前连接的数据库类型,这里使用org.springframework.jdbc.core.JdbcTemplate类。 依赖: <dependency> <groupId>org.springframework.boot</groupId> <artif...
Spring注解@Controller和@RestController的区别?
官方文档:Annotation Type RestController 解释说:A convenience annotation that is itself annotated with @Controller and @ResponseBody。 也就是@RestController注解相当于控制器前加@Co...
CentOS7将SpringCloud服务配置成后台服务并设置开机自启的N种方式
1. 环境说明 * CentOS Linux release 8.2.2004 (Core) 2. 配置方式 2.1 运行shell脚本的方式 1)创建脚本 在/usr/bin目录下创建脚本,比如我的脚本名为/usr/bin/ruoyi-gen.sh,内容如下: #!/bi...
