排序
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...
Spring BOOT三步入门
三步开始一个Spring Boot项目: 1.官网生成框架代码 访问 https://start.spring.io/,添加自己需要的依赖,这里添加web依赖,如下图: 2.新建一个RestController 使用IDEA,File->Open打开解...
Springboot提示No beans of ‘RestTemplate’ type found错误
错误信息 在使用RestTemplate时,IntelliJ Idea提示Could not autowire. No beans of 'RestTemplate' type found.。 代码清单: @Component public class SmsUtil { @Autowired private RestTem...
已解决:SpringBoot使用Swagger2提示Unable to infer base url错误
环境 版本: swagger2 2.9.2; 错误信息 访问swagger首页 http://localhost:8080/swagger-ui.html,错误信息如下: Unable to infer base url. This is common when using dynamic servlet regi...


