SpringBoot
文章平均质量分 79
SpringBoot
I like study.
热爱技术
展开
-
SpringBoot2.x配置文件绝对路径的映射
package per.czt.config; import java.util.List; import org.springframework.context.annotation.Configuration; import org.springframework.format.FormatterRegistry; import org.springframework.http.convert...原创 2019-10-16 18:08:04 · 815 阅读 · 0 评论 -
Vue axios跨域配置proxyTable404错误
配置的config/index.js proxyTable: { '/apia':{ target:'https://api.caiyunapp.com',//目标接口域名 changeOrigin: true,//是否跨域 pathRewrite:{ '^/apia': ''//重写接口,后面可以使重写的新路径,一...原创 2019-10-09 00:13:53 · 2714 阅读 · 0 评论 -
SpringBoot实现邮件发送
1.进入163邮箱开启授权 点击设置中的POP3/SMTP/IMAP,然后点击左侧的客户端授权密码 输入授权密码后开启授权 2.创建springboot项目,导入相关依赖 常规的依赖就不写了,这里要特别导入mail <dependency> <groupId>org.springframework.boot</groupId> <arti...原创 2019-08-18 08:42:43 · 182 阅读 · 0 评论 -
SpringBoot整合JPA出现javax.net.ssl.SSLException: closing inbound before receiving peer's close_notify
错误信息: STACKTRACE: javax.net.ssl.SSLException: closing inbound before receiving peer’s close_notify at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:129) at java.base/sun.security.ssl....原创 2019-07-18 07:48:15 · 524 阅读 · 0 评论 -
springboot多环境配置
1.编写配置文件 开发环境 application-dev.properties server.port=8080 测试环境application-test.properties server.port=8081 生产环境application-prod.properties server.port=8082 2.使用maven把项目打包为一个jar包 使用clean install命令打...原创 2019-07-29 09:44:16 · 171 阅读 · 0 评论 -
SpringBoot使用logback日志记录器
logback为log4j的扩展,是一种日志记录器 使用方式: 用maven导入springboot相关依赖后就会拥有logback的相关jar包,我们只需要在src/main/resources下写一个logback.xml文件 <?xml version="1.0" encoding="UTF-8" ?> <configuration> <!--定义日志文件的存...原创 2019-07-29 09:06:15 · 265 阅读 · 0 评论 -
springboot配置文件
1.application.properties springboot默认配置文件为application.properties 例子 application.properties #设置随机端口 server.port=${random.int[1024,9999]} hello=Hello name=springboot msg= ${hello} ${name} ! #确立一个随机数,该数...原创 2019-07-29 08:46:08 · 93 阅读 · 0 评论 -
SpringBoot整合ehcache、redis
1.SpringBoot和ehcache pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://...原创 2019-07-19 09:56:27 · 352 阅读 · 0 评论 -
SpringBoot整合SpringData JPA
1.创建maven项目,编写pom.xml文件 pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http...原创 2019-07-18 17:27:03 · 204 阅读 · 0 评论 -
SpringBoot整合Junit进行单元测试
1.创建项目,编写pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache...原创 2019-07-13 19:49:54 · 148 阅读 · 0 评论 -
SpringBoot处理异常的几种方式
1.通过编写error.html处理异常 比如,先写一个DemoController package per.czt.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller pu...原创 2019-07-13 19:11:47 · 160 阅读 · 0 评论 -
SpringBoot表单验证
SpringBoot的表单验证是通过hibernate-validator.jar的方法实现的 1.创建maven项目,编写pom.xml文件 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation...原创 2019-07-13 18:36:55 · 395 阅读 · 0 评论 -
SpringBoot+Mybatis注解方式实现关联查询
User实体类 package per.czt.pojo; import org.springframework.boot.autoconfigure.domain.EntityScan; public class User { private Integer user_id; private Town town; private String user_account; pr...原创 2019-06-23 18:18:29 · 3363 阅读 · 0 评论 -
SpringBoot文件上传
项目目录如下 1.创建maven项目,导入springboot的maven依赖 pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.o...原创 2019-06-20 21:04:37 · 212 阅读 · 0 评论 -
SpringBoot静态资源访问的两种方式
1.首先创建maven项目,导入springboot的maven依赖 4.0.0 org.springframework.boot spring-boot-starter-parent 1.5.2.RELEASE </parent> <groupId>per.czt.05-spring-boot-static-resources</groupId> <...原创 2019-06-20 20:53:43 · 1028 阅读 · 0 评论 -
SpringBoot整合listener两种方式
1.创建maven项目,导入springboot的maven依赖 pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4...原创 2019-06-20 20:41:38 · 6569 阅读 · 0 评论 -
SpringBoot整合Filter的两种方式
1.创建maven项目,导入springboot的maven依赖 pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4...原创 2019-06-20 20:35:32 · 1579 阅读 · 0 评论 -
SpringBoot整合Servlet的两种方式
1.创建maven项目,导入springboot的maven依赖 pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4...原创 2019-06-20 20:18:48 · 2385 阅读 · 0 评论 -
SpringBoot入门
1.创建一个maven项目 1.在pom.xml文件 导入SpringBoot的Maven依赖包 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.o...原创 2019-06-20 17:00:07 · 89 阅读 · 0 评论
分享