
SpringBoot
OveRrIde丶
从入门到删库跑路✔
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
【SpringBoot学习】27-整合Redis使用Util类
结构redis工具类略mapper略service@Servicepublic class ProviderService { @Autowired RedisClient redisClient; @Autowired ProviderMapper providerMapper; public Provider getProvid...原创 2020-03-15 17:41:02 · 204 阅读 · 0 评论 -
【SpringBoot学习】26-整合Redis
引入依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency>...原创 2020-03-15 16:31:08 · 117 阅读 · 0 评论 -
【Springboot项目】登录整合kaptcha验证码插件
依赖 <dependency> <groupId>com.github.penggle</groupId> <artifactId>kaptcha</artifactId> <version>2.3.2</version> ...原创 2020-03-22 10:09:30 · 1062 阅读 · 0 评论 -
【SpringBoot项目】pageHelper对查询分页并显示页面
所需依赖<dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper-spring-boot-starter</artifactId> <version>1.2....原创 2020-03-21 14:14:29 · 1870 阅读 · 0 评论 -
【SpringBoot学习】25- @CacheEvict清除缓存
allEntries = true 调用之后清空所有缓存beforeInvocation = true 调用之前清空 @Delete("delete from user where id = #{id}") int deleteUser(Integer id); /** * allEntries = true 调用之后清空所有缓存 * ,beforeIn...原创 2020-03-15 14:23:20 · 3280 阅读 · 0 评论 -
【SpringBoot学习】24-@CachePut 更新数据 同步缓存
@CachePut 会在方法完成后 将数据添加至缓存 @Update("UPDATE `user` SET `username` = #{username}, `real_name` = #{realName}, `password` = #{password}, `gender` =#{gender}, `user_type` = #{userType} WHERE `id` = #{...原创 2020-03-15 11:53:32 · 1323 阅读 · 2 评论 -
【SpringBoot学习】23-@Cacheable实现
配置类略依赖导入<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-cache</artifactId> </dependency>...原创 2020-03-15 11:24:12 · 305 阅读 · 0 评论 -
【SpringBoot学习】01-yml和properties配置文件
springboot 配置文件 高优先级会覆盖低优先级的配置 高优先级后加载正常的情况是先加载yml,接下来加载properties文件。如果相同的配置存在于两个文件中。最后会使用properties中的配置。最后读取的优先集最高。两个配置文件中的端口号不一样会读取properties中的端口号。原创 2020-03-03 19:31:15 · 153 阅读 · 0 评论 -
【SpringBoot学习】02-th:replace与th:insert详解
声明公共代码片段通过th:fragment <div th:fragment="header_common"> <p>这是fragment公共片段</p> </div>通过id声明代码片段 <div id="header_common_id"> <p>这是id公共片段&l...原创 2020-03-04 11:13:22 · 2385 阅读 · 0 评论 -
【SpringBoot学习】03-th:each的使用
迭代<table border="1px"> <tr> <th>编号</th> <th>姓名</th> <th>性别</th> <th>总记录数</th> ...原创 2020-03-04 12:06:56 · 1479 阅读 · 0 评论 -
【SpringBoot学习】04-th:if、th:unless、th:switch以及th:case
th:if、th:unlessth:if 如果值为true 则显示出该标签 否则 不显示(隐藏)#lists.isEmpty(userList) true 集合为空#lists.isEmpty(userList) false 集合非空 <h3 th:if ="not ${#lists.isEmpty(userList)}">显示 出来userList非空 </h...原创 2020-03-04 12:55:10 · 4173 阅读 · 0 评论 -
【SpringBoot学习】05-自定义LocaleResolver国际化区域语言
首先配置好i18n文件 以及所对应的语言在properties中配置因为默认为 messagespring.messages.basename=i18n.xxxx页面内容替换配置点击配置一个 LocaleResolver 自定义类public class MyLocaleResolver implements LocaleResolver { //解析区域信息 ...原创 2020-03-05 15:16:46 · 1499 阅读 · 2 评论 -
【SpringBoot学习】06-自定义视图控制器的两种方式
继承 WebMvcConfigurer 接口@Configurationpublic class MySpringMvcConfigurer implements WebMvcConfigurer { //增加视图控制 @Override public void addViewControllers(ViewControllerRegistry registry) {...原创 2020-03-05 15:19:40 · 623 阅读 · 0 评论 -
【SpringBoot学习】07-springboot 使用 post 转发 put 请求
发送put请求修改供应商信息在SpringMVC中配置HiddenHttpMethodFilter(SpringBoot自动配置好了)页面创建一个method="post"表单–>创建一个input标签 name="_method",value=“指定请求方式”页面:<form id="updateForm" action="#" th:action="@{/provi...原创 2020-03-06 01:24:01 · 1345 阅读 · 0 评论 -
【SpringBoot学习】08-自定义嵌入式servlet
1-自定义servlet组件/** * 自定义servlet组件 * @author AnQi * @date 2020/3/7 16 33:46 * @description */public class HelloServlet extends HttpServlet { //处理get请求 @Override protected void doGet(...原创 2020-03-07 18:05:12 · 107 阅读 · 1 评论 -
【SpringBoot学习】09-自定义定制器修改嵌入式servlet配置
除了使用application.properties配置还可以使用自定义定制器进行配置#端口server.port=8081#应用名server.servlet.context-path=/servletserver.tomcat.max-connections=8000在配置类中添加方法如果配置文件中和定制器冲突 优先使用自定义定制器的 @Bean public ...原创 2020-03-07 18:08:43 · 133 阅读 · 0 评论 -
【SpringBoot学习】10-错误处理
当在页面访问时出现类似404、500之类的错误,直接给用户返回报错页面是及其不友好的如果集成了thymeleaf则可以在template下直接在error文件夹,创建对应错误代码的html页面该页面也可以通过th语句获取错误信息如果在static和templates中都创建了error文件夹,并对应了错误代码则会优先选择准确的代码html否则会选择templates中的<bod...原创 2020-03-07 18:18:12 · 128 阅读 · 0 评论 -
【SpringBoot学习】12-搭建Druid后台监控管理
在10-的基础上 进行下一步操作在Druid配置类中 配置@Configurationpublic class DruidConfig { @ConfigurationProperties(prefix = "spring.datasource") @Bean public DataSource druid(){ return new DruidDa...原创 2020-03-08 09:47:14 · 219 阅读 · 0 评论 -
【SpringBoot学习】11-Jdbc搭建以及配置Druid连接池
1、首先几个必须的依赖JDBC <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency>...原创 2020-03-07 23:55:17 · 211 阅读 · 0 评论 -
【SpringBoot学习】13-整合Mybatis-3.x(注解版)
首先构建项目选择mybatis 会自动生成依赖 生成所需要的mybatis启动器1、配置yml文件spring: datasource: username: root password: xxxxx url: jdbc:mysql://127.0.0.1:3306/mybatis-boot?serverTimezone=GMT%2B8 driver-clas...原创 2020-03-08 10:29:28 · 202 阅读 · 0 评论 -
【SpringBoot学习】14-整合Mybatis3.x(配置文件版)
1、配置文件yml除了11中的 基本datasource 和 druid 配置外需要指定mybatis的基本配置mapper 以及 config 的文件位置mybatis: config-location: classpath:mybatis/mybatis-config.xml mapper-locations: classpath:mybatis/mapper/*.xml2...原创 2020-03-08 11:02:51 · 274 阅读 · 0 评论 -
【SpringBoot学习】15-SpringData-JPA整合
1、yml配置文件spring: datasource: username: root password: xxxxx url: jdbc:mysql://127.0.0.1:3306/jpa-boot?serverTimezone=GMT%2B8 driver-class-name: com.mysql.cj.jdbc.Driver jpa: h...原创 2020-03-08 14:47:29 · 120 阅读 · 0 评论 -
【SpringBoot学习】16-增-操作(Mybatis配置文件版)
1、实体类public class Provider { private Integer pid; //供应商编码 private String providerCode; //供应商名称 private String providerName; //联系人 private String people; //联系电话 pri...原创 2020-03-10 12:50:15 · 105 阅读 · 0 评论 -
【SpringBoot学习】17-查询-操作(Mybatis配置文件版)
1、实体类public class Provider { private Integer pid; //供应商编码 private String providerCode; //供应商名称 private String providerName; //联系人 private String people; //联系电话 pri...原创 2020-03-10 13:22:43 · 162 阅读 · 0 评论 -
【SpringBoot学习】18-修改-操作(Mybatis配置文件版)
1、实体类public class Provider { private Integer pid; //供应商编码 private String providerCode; //供应商名称 private String providerName; //联系人 private String people; //联系电话 pri...原创 2020-03-10 13:31:46 · 298 阅读 · 1 评论 -
【SpringBoot学习】19-删除-操作(Mybatis配置文件版)
1、实体类public class Provider { private Integer pid; //供应商编码 private String providerCode; //供应商名称 private String providerName; //联系人 private String people; //联系电话 pri...原创 2020-03-10 13:40:39 · 578 阅读 · 0 评论 -
【SpringBoot学习】20-异步处理
1、模拟批量添加数据/** * 异步处理 批量操作 * @author AnQi * @date 2020/3/11 17 26:52 * @description */@Servicepublic class AsynService { @Async public void batchAdd(){ try { Thread...原创 2020-03-11 17:36:57 · 187 阅读 · 0 评论 -
【SpringBoot学习】21-定时任务
定时任务Service点我在线生成cron需要在方法前使用@Scheduled 并且书写cron表达式 (cron = “1-30 * * * * MON-FRI”)/** * 创建定时任务 * @author AnQi * @date 2020/3/11 17 41:28 * @description */@Servicepublic class ScheduledSer...原创 2020-03-11 18:37:40 · 160 阅读 · 0 评论 -
【SpringBoot学习】22-邮件操作
1、application.properties配置文件#配置邮箱信息spring.mail.username=登录的邮箱spring.mail.password=对应授权码#发送右键服务器spring.mail.host=smtp.qq.com#ssl安全连接spring.mail.properties.smtp.ssl.enable=true2、测试类中演示1)发送简单邮...原创 2020-03-11 23:25:45 · 79 阅读 · 0 评论