相信技术的力量

Springboot工作日志

Springboot 共用属性

https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html

Logback日志管理

https://www.cnblogs.com/lixuwu/p/5804793.html

https://blog.csdn.net/qq_39543482/article/details/80337345

https://www.cnblogs.com/zhangjianbing/p/8992897.html

https://www.cnblogs.com/mr-yang-localhost/p/8284317.html

https://juejin.im/post/5afbe1c6f265da0ba469f966

中文乱码问题

修改application.properties文件 , 增加如下配置:

spring.http.encoding.force=true
spring.http.encoding.charset=UTF-8
spring.http.encoding.enabled=true
server.tomcat.uri-encoding=UTF-8

打包失败

 Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.3.6.RELEASE:repackage failed: Unable to find a single main class from the following candidates [com.MyApplication, com.util.PrimaryKeyUtil, com.data.dbobj.Task]

解决:

程序中有多个main()入口方法, 只保留MyApplication中的即可

@RequestBody 注解

@RequestBody注解常用来处理content-type不是默认的application/x-www-form-urlcoded编码的内容,比如说:application/json或者是application/xml等。一般情况下来说常用其来处理application/json类型

通过@RequestBody可以将请求体中的JSON字符串绑定到相应的bean上,当然,也可以将其分别绑定到对应的字符串上(方法中的两个参数都加此注解)

https://blog.csdn.net/shine0112/article/details/72778518

⬆️