- 博客(14)
- 收藏
- 关注
原创 PostgreSQL避免每次数据插入时都去查询数据是否存在问题
场景介绍:在日常开发中,都会碰到每次插入数据之前都需判断这条数据是否存在,若存在则不进行插入,若不存在则进行插入的场景。方法介绍:方法一:最基本的方法是插入之前先select,再insert,这适用于少量数据,当数据量越大,这种方法就显得效率极为低下。方法二:建立索引先给数据库字段建立唯一索引(本文遇到的问题需要建立组合索引保证唯一性);CREATE UNIQUE INDEX indexName on table (column1, column2)插入数据的SQLinse..
2022-05-18 14:09:40
600
原创 在SSM项目中下载(导出)excel表格
导入相关依赖<!-- https://mvnrepository.com/artifact/org.apache.poi/poi --> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>5.0.0</version> </depe..
2021-06-20 22:22:44
278
原创 在SSM项目中进行文件上传
导入相关依赖<!-- https://mvnrepository.com/artifact/commons-fileupload/commons-fileupload --> <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> <version&..
2021-06-20 22:21:42
127
原创 简单使用支付宝沙箱接口模拟支付(网页&移动应用类)
导入相关依赖<!-- https://mvnrepository.com/artifact/com.alipay.sdk/alipay-sdk-java --> <dependency> <groupId>com.alipay.sdk</groupId> <artifactId>alipay-sdk-java</artifactId> <version>4.13.50.ALL..
2021-06-20 22:20:17
1658
原创 关于PageHelper插件的简单使用
关于PageHelper插件的简单使用导入相关依赖 <!-- https://mvnrepository.com/artifact/com.github.pagehelper/pagehelper --> <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper</artifactId> &
2021-06-20 22:17:57
53
原创 在SpringBoot中集成Swagger(随笔)
在SpringBoot中集成Swagger(随笔)本项目是在Swagger3.0版本下的使用导入相关依赖 <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-boot-starter</artifactId> <version>3.0.0</version>
2021-05-05 18:33:23
76
原创 在SpringBoot中简单使用Shiro(随笔)
导入相关依赖<!-- https://mvnrepository.com/artifact/org.apache.shiro/shiro-spring --> <dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-spring</artifactId> <ve..
2021-05-02 22:22:20
86
原创 IDEA中不能下载源码问题(日常小问题)
IDEA中不能下载源码问题(日常小问题)Cannot Download Sources Sources not found for: xxx.xxx.xxxx在Terminal命令终端下输入:mvn dependency:resolve -Dclassifier=sources
2021-04-30 21:05:42
110
1
原创 在SpringBoot中简单使用Spring Security(随笔)
在SpringBoot中简单使用Spring Security(随笔)导入相关依赖 ;<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId></dependency>定义一个Spring Security配置类继承自WebSec
2021-04-29 21:06:43
91
1
原创 在Spring Boot中嵌入Thymeleaf模板引擎(随笔)
在Spring Boot中嵌入Thymeleaf模板引擎(随笔)1.模板引擎: 是为了使用户界面与业务数据(内容)分离而产生的,它可以生成特定格式的文档,用于网站的模板引擎会生成一个标准的HTML文档。使用模板引擎的目的就是为了使前后端分离。2.Thymeleaf 官网解释:Thymeleaf is a modern server-side Java template engine for both web and standalone environments.(翻译:Thymeleaf是
2021-04-11 11:06:46
150
原创 SpringBoot中的拦截器Interceptor(随笔)
SpringBoot中的拦截器Interceptor(随笔)1)定义拦截器:定义一个拦截器类实现HandlerInterceptor接口,重写preHangle()方法;public class OneInterceptor implements HandlerInterceptor { @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object
2021-04-09 21:20:42
541
4
原创 SpringBoot中的日志(随笔)
SpringBoot中的日志(随笔)SpringBoot中默认日志技术为logback。log back是由log4j创始人设计的又一款开源日志组件,其当前分为三个模块:logback-core:是其他两个模块的基础;logback-classic:是log4j的一个改良版本;logback-access:与Servlet容器集成提供通过Http来访问日志的功能。Springboot中的logback用法1)在主配置文件中对logback进行配置:logging: level: wa
2021-04-09 20:08:51
57
原创 SpringBoot中Filter(过滤器)的使用
SpringBoot中Filter(过滤器)的使用(随笔)1)注解方式(基于Servlet3.0+版本) 新建Filter类(实现Filter接口),在Filter类上加@WebFilter(需要过滤的请求) 注解;@WebFilter("/*") //过滤所有请求public class OneFilter implements Filter 在SpringBoot启动类上加@ServletComponentScan(包名)注解,扫描filter与 servlet类所在的包。2)
2021-04-09 18:25:41
217
原创 SpringBoot中使用Servlet的方式
SpringBoot中使用Servlet的方式1)注解方式(对于Servlet3.0+版本的使用) 定义Servlet类继承自HttpServlet,并在Servlet类上加@WebServlet注解;@WebServlet("/first") //指定访问路径public class OneServlet extends HttpServlet 在项目启动类上加@ServletComponentScan注解2)通过配置方式(对于Servlet2.5+版本的使用) 定义Servl
2021-04-09 15:35:08
100
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人