
SpringBoot
文章平均质量分 70
SpringBoot学习记录
Lee_01
coder
展开
-
MyBatis学习笔记
MyBatismybatis官方文档:https://mybatis.org/mybatis-3/zh/mybatis-spring官方文档:http://mybatis.org/spring/zh/mybatis-spring-boot-autoconfigure教程:https://how2j.cn/k/mybatis/mybatis-tutorial/1087.htmlxml方式使用步骤1.引入依赖:数据库驱动+mybatis<dependencies> <原创 2022-05-01 22:06:33 · 299 阅读 · 0 评论 -
@DateTimeFormat、@JsonFormat、@JsonIgnore、@JsonProperty
@DateTimeFormat、@JsonFormat、@JsonIgnore、@JsonProperty、@JsonInclude、@JSONField@DateTimeFormat用途:入参格式化用于:@RequestParam入参,@RequestBody对象属性来源:spring-context@JsonFormat用途:出参格式化用于:对象属性来源:jackson@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")@JsonFor原创 2021-06-27 00:11:07 · 429 阅读 · 0 评论 -
mybatis+Oracle批量插入
mybatis+Oracle批量插入注意:Oracle不能像MySQL一样在values后面接多条数据生成32位UUID主键用sys_guid()<insert id="batchInsert" parameterType="java.util.List"> INSERT INTO STUDENTS(ID,NAME,AGE) SELECT T.* FR...原创 2019-12-27 19:51:46 · 364 阅读 · 0 评论 -
mybatis插入数据的字段为null时报异常
mybatis插入数据的字段为null时报异常Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #6 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcT...原创 2019-12-25 00:47:40 · 1100 阅读 · 0 评论 -
java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springSecurityFilterChain' defined in class path resource [org/springframework/security/config/annotation/web/c...原创 2019-09-22 01:58:02 · 1984 阅读 · 0 评论 -
Using org.hibernate.id.UUIDHexGenerator which does not generate IETF RFC 4122 compliant UUID values
Hibernate 主键生成uuid策略报警告:Using org.hibernate.id.UUIDHexGenerator which does not generate IETF RFC 4122 compliant UUID values@GenericGenerator(name = "idGenerator1", strategy = "uuid")@GeneratedVal...原创 2019-12-04 19:04:48 · 2797 阅读 · 0 评论 -
Spring Data JPA 连接 Oracle报错:不支持的字符集 (在类路径中添加 orai18n.jar) ZHS16GBK
Spring Data JPA 连接 Oracle报错:不支持的字符集 (在类路径中添加 orai18n.jar): ZHS16GBK错误信息:Caused by: java.sql.SQLException: 不支持的字符集 (在类路径中添加 orai18n.jar): ZHS16GBKat oracle.sql.CharacterSetUnknown.failCharsetUnknow...原创 2019-12-09 17:45:59 · 2695 阅读 · 0 评论 -
'org.springframework.data.redis.connection.RedisConnectionFactory' that could not be found
Description:Field connectionFactory in com.lee.securityoauth2.config.AuthorizationServerConfig required a bean of type 'org.springframework.data.redis.connection.RedisConnectionFactory' that could ...原创 2019-09-22 01:55:07 · 11729 阅读 · 1 评论 -
Maven打包Springboot docker报错
问题:No plugin found for prefix 'docker' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories解决方法:Maven的配置文件settings.xml,添...原创 2019-10-24 20:49:27 · 351 阅读 · 0 评论 -
Spring Boot+OAuth2使用GitHub登录自己的服务
网站利用 OAuth2 提供第三方登录(GitHub)授权码模式A 网站让用户跳转到 GitHubGitHub 要求用户登录,然后询问"A 网站要求获得 xx 权限,你是否同意?"用户同意,GitHub 就会重定向回 A 网站,同时发回一个授权码 code ,附在回调地址后A 网站使用授权码,向 GitHub 请求令牌 tokenGitHub 返回令牌 tokenA 网站使用令牌,...原创 2019-12-25 00:56:30 · 4375 阅读 · 3 评论 -
Spring Boot接收和返回日期参数
Spring Boot接收和返回日期参数方式一在实体类上加@DatetimeFormat与``@JsonFormat`注解将前台日期字符串转换成Date格式 @DateTimeFormat(pattern="yyyy-MM-dd"),可以加在实体类字段或controller参数上// 开始时间@DateTimeFormat(pattern = "yyyy-MM-dd HH:m...原创 2019-12-12 19:33:04 · 5194 阅读 · 1 评论 -
从 Spring security oauth2 client 自动配置中获取当前登录用户信息
从 Spring security oauth2 client 自动配置中获取当前登录用户信息方法一:在AuthenticationSuccessHandler实现类中获取缺点:获取用户信息后需要做跳转,底层框架并不会自动跳转回未授权之前访问的页面package com.lee.demo.handler;import lombok.extern.slf4j.Slf4j;import...原创 2019-11-27 19:54:02 · 6914 阅读 · 1 评论 -
从 Spring security oauth2 client 自动配置中获取 AccessToken
问题使用 Spring security oauth2 client 实现授权码模式,可以不用手动拼接url请求code和token等信息,用户登录成功之后可以在SuccessHandler中获取当前用户的信息。如果还想获取用户信息以外的授权资源,必须要有AccessToken,要怎么获取呢?先看下如何获取用户信息依赖<dependency> <groupId>...原创 2019-11-15 20:24:02 · 5783 阅读 · 0 评论 -
RestTemplate使用笔记
带请求头,请求体的post请求HttpHeaders requestHeaders = new HttpHeaders();requestHeaders.add("accept", "application/json");// AccessToken放在请求头中requestHeaders.add("Authorization", "Bearer " + accessToken);// ...原创 2019-12-25 00:40:43 · 208 阅读 · 0 评论 -
在Springboot项目中使用Swagger文档
在Springboot项目中使用Swagger文档0.参考博客:https://www.ibm.com/developerworks/cn/java/j-using-swagger-in-a-spring-boot-project/index.htmlhttps://blog.youkuaiyun.com/itguangit/article/details/78978296https://...原创 2019-12-08 23:43:11 · 557 阅读 · 0 评论 -
Springboot整合持久层技术笔记
一、整合SpringData JPA1.MySQL(8.0.13)serverTimezone,参考文章1,文章2使用MySQL数据库报错Caused by: java.sql.SQLException: The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zo...原创 2019-09-17 11:36:13 · 669 阅读 · 0 评论 -
SpringBoot 在idea中实现热部署
1.修改pom文件<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> <...原创 2019-09-17 10:20:16 · 123 阅读 · 0 评论 -
SpringBoot笔记
SpringBoot笔记接收前端参数方法一请求路径可以简化成@PathVariable Integer id@GetMapping(value = "/test/{id}")public String test(@PathVariable("id") Integer id){ return "id:"+id;}方法二请求参数,http://localhost:80...原创 2019-11-22 22:04:36 · 155 阅读 · 0 评论