随笔分类 -  Java框架 / SpringBoot

摘要:https://www.xuxueli.com/xxl-job/#%E3%80%8A%E5%88%86%E5%B8%83%E5%BC%8F%E4%BB%BB%E5%8A%A1%E8%B0%83%E5%BA%A6%E5%B9%B3%E5%8F%B0XXL-JOB%E3%80%8B 1.调度中心 运行调 阅读全文
posted @ 2024-04-04 16:11 lwx_R 阅读(10) 评论(0) 推荐(0) 编辑
摘要:@Scheduled(cron = "0 0 */3 * * ?")//定时任务注解 public void fun() { } 阅读全文
posted @ 2023-12-31 01:36 lwx_R 阅读(8) 评论(0) 推荐(0) 编辑
摘要:1.依赖 <!--状态机--> <dependency> <groupId>org.springframework.statemachine</groupId> <artifactId>spring-statemachine-core</artifactId> <version>2.0.1.RELE 阅读全文
posted @ 2023-12-14 11:05 lwx_R 阅读(97) 评论(0) 推荐(0) 编辑
摘要:1.@RequestParam Content-Type: application/x-www-form-urlencoded 一般是form直接发送请求 postman 使用form-data来传值 2.@RequestBody contentType: "application/json; ch 阅读全文
posted @ 2023-10-10 23:50 lwx_R 阅读(7) 评论(0) 推荐(0) 编辑
摘要:Java17以上 1.依赖 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>3.0.0</version> <relat 阅读全文
posted @ 2023-10-04 17:45 lwx_R 阅读(88) 评论(0) 推荐(0) 编辑
摘要:## 1.静态资源映射规则 #### 1.1 webjars SpringMVC的配置类WebMvcAutoConfiguration中addResourceHandlers添加资源处理 有一个webjars:以jar包的方式引入我们的静态资源 ```xml org.webjars jquery 3 阅读全文
posted @ 2023-06-29 17:39 lwx_R 阅读(29) 评论(0) 推荐(0) 编辑
摘要:1.数据验证 日常项目开发中,对于前端提交的表单,后台接口接收到表单数据后,为了程序的严谨性,通常后端会加入 业务参数的合法校验操作来避免程序的非技术性bug,这里对于客户端提交的数据校验 SpringBoot通过spring-boot-starter-validation模块包含了数据校验的工作。 阅读全文
posted @ 2022-10-30 17:13 lwx_R 阅读(113) 评论(0) 推荐(0) 编辑
摘要:1.事务支持 在使用]dbc作为数据库访问技术时,Spring Boot框架定义了基于jdbc的PlatformTransactionManager接口 的实现DataSourceTransactionManager,并在Spring Boot应用启动时自动进行配置。 这里Spring Boot集成 阅读全文
posted @ 2022-10-30 11:54 lwx_R 阅读(36) 评论(0) 推荐(0) 编辑
摘要:1.什么是定时调度 在SpringBoot中有Java自带的java.util.Timer类 SpringBoot自带的Scheduled来实现,Scheduled 在Spring3.X引入,默认SpringBoot自带该功能使用起来也很简单,在启动类级别添加 @EnableScheduling注解 阅读全文
posted @ 2022-10-30 11:11 lwx_R 阅读(34) 评论(0) 推荐(0) 编辑
摘要:1.pom.xml <!-- 单元测试--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> </dependency> 2.目录结构 阅读全文
posted @ 2022-10-27 18:24 lwx_R 阅读(12) 评论(0) 推荐(0) 编辑
摘要:1.什么是EhCache EhCache是一个比较成熟的Java缓存框架,最早从hibernate发展而来,是进程中的缓存系统 它提供了用内存,磁盘文件存储,以及分布式存储方式等多种灵活的cache管理方案,快速简单。 2.注解使用 2.1 @Cacheable 应用到读取数据的方法,即可缓存的方法 阅读全文
posted @ 2022-10-27 18:21 lwx_R 阅读(644) 评论(0) 推荐(0) 编辑
摘要:1.什么是热部署 热部署,就是在应用正在运行的时候升级软件(增加业务/修改bug),却不需要重新启动应用 在项目开发过程中,常常会改动页面数据或者修改数据结构,为了显示改动效果,往往需要重启应用查看改变效果, 其实就是重新编译生成了新的Class文件,这个文件里记录着和代码等对应的各种信息,然后Cl 阅读全文
posted @ 2022-10-26 17:51 lwx_R 阅读(569) 评论(0) 推荐(0) 编辑
摘要:1.pom.xml配置 <!-- mybatis--> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.1. 阅读全文
posted @ 2022-10-25 18:10 lwx_R 阅读(17) 评论(0) 推荐(0) 编辑
摘要:swagger2 用来生产Api文档 1.pom.xml配置 <!-- swagger2 Api文档--> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <versio 阅读全文
posted @ 2022-10-25 17:58 lwx_R 阅读(22) 评论(0) 推荐(0) 编辑
摘要:1.打包为Jar 配置操作为clean compile package -Dmaven.test.skip=true debug 操作 在target目录下 2.打包为war包 2.1 pom修改 添加packaging <groupId>org.example</groupId> <artifac 阅读全文
posted @ 2022-10-24 19:59 lwx_R 阅读(39) 评论(0) 推荐(0) 编辑
摘要:1.在ResourceProperties类下 private static final String[] CLASSPATH_RESOURCE_LOCATIONS = new String[]{"classpath:/META-INF/resources/", "classpath:/resour 阅读全文
posted @ 2022-10-24 18:51 lwx_R 阅读(13) 评论(0) 推荐(0) 编辑
摘要:可以使用 properties 文件、YAML 文件进行配置,放入resources目录下 1.application.properties environments.dev.url=http://dev.example.com environments.dev.name=Developer Set 阅读全文
posted @ 2022-09-26 12:13 lwx_R 阅读(77) 评论(0) 推荐(0) 编辑
摘要:1.在resources文件下新建Banner.txt可以修改启动图标 2.使用 spring.main.banner-mode 属性 //关闭banner图标 SpringApplication app = new SpringApplication(App.class); app.setBann 阅读全文
posted @ 2022-09-26 12:08 lwx_R 阅读(122) 评论(0) 推荐(0) 编辑
摘要:1.创建普通web项目 2.在pom.xml里添加依赖 父依赖版本低 rest风格的GetMapper注解没有 <!-- Spring Boot 启动父依赖 --> <parent> <groupId>org.springframework.boot</groupId> <artifactId>sp 阅读全文
posted @ 2022-09-24 19:02 lwx_R 阅读(28) 评论(0) 推荐(0) 编辑

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