随笔分类 -  SpringBoot

摘要:SpringBoot默认使用Jackson解析Json字符串 Controller方法参数有个LocalDateTime时间字段,数据格式为:2022-05-11 00:00:00 报错: org.springframework.http.converter.HttpMessageNotReadab 阅读全文
posted @ 2022-06-15 21:17 originyuan 阅读(10837) 评论(0) 推荐(4) 编辑
摘要:【-D】和【--】两种写法都可以在命令行传入参数,实现覆盖 application.properties 中的配置项,不过写法有些不同 【-D】虚拟机参数 以运行jar包为例,写法为: # 参数写法为:-Dproperty=value java -Dserver.port=1234 -jar app 阅读全文
posted @ 2022-06-11 16:58 originyuan 阅读(6619) 评论(0) 推荐(2) 编辑
摘要:SpringBoot 整合 Redis 1、添加依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependen 阅读全文
posted @ 2022-05-29 00:09 originyuan 阅读(436) 评论(0) 推荐(0) 编辑
摘要:基本配置 方法一:注解方式 @Component @WebFilter(urlPatterns = "/*", filterName = "FirstFilter") public class FirstFilter implements Filter { @Override public void 阅读全文
posted @ 2022-05-07 22:13 originyuan 阅读(360) 评论(0) 推荐(0) 编辑
摘要:最近项目里使用到了多个拦截器,由于业务需要按顺序执行拦截器,各个拦截器处理不同的内容。 拦截器1: public class PathInterceptor implements HandlerInterceptor { @Override public boolean preHandle(Http 阅读全文
posted @ 2022-05-07 21:40 originyuan 阅读(4857) 评论(1) 推荐(1) 编辑
摘要:Spring Boot的配置文件: 虚拟机参数: 阅读全文
posted @ 2021-07-25 22:18 originyuan 阅读(519) 评论(0) 推荐(0) 编辑
摘要:使用Thymeleaf传递url参数 路径变量 <a href="#" th:href="@{/admin/{id}/delete(id=${comment.id})}" >删除</a> 设置参数名,末尾加(xx=) 即可设置路径变量 url单参数 <a th:href="@{/admin(page 阅读全文
posted @ 2020-09-30 22:42 originyuan 阅读(3588) 评论(0) 推荐(1) 编辑
摘要:本文不是对Swagger的学习,只是记录如何配置Swagger 简单学习Swagger可以看这篇博文:swagger使用指南 Swagger Api注解速览 @Api: 用于类,标识这个类是swagger的资源 @ApiIgnore: 用于类,忽略该 Controller,指不对当前类做扫描 @Ap 阅读全文
posted @ 2020-08-22 16:53 originyuan 阅读(885) 评论(0) 推荐(1) 编辑
摘要:<button type="button" th:onclick="|javascript:fun(${article.id})|" >按钮</button> 解析后 <button type="button" onclick="javascript:fun(1)">按钮</button> 也可以直 阅读全文
posted @ 2020-07-18 22:01 originyuan 阅读(521) 评论(0) 推荐(0) 编辑
摘要:转载:https://www.jianshu.com/p/6dcfe16d91d0 序言:SpringBoot 的核心理念是约定优于配置,例如在资源目录的static放置静态资源就能直接访问,templates目录放置动态页面就能自动初始化和实现访问,例如Thymeleaf、FreeMaker等。 阅读全文
posted @ 2020-05-29 11:21 originyuan 阅读(1175) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示