1:Spring boot 项目默认的web服务器为tomcat,故排除tomcat依赖,加入jetty依赖,请看下图:
注:Spring boot版本:1.4.7.RELEASE Jetty:jetty-9.3.19.v20170502
<!--最新版的1.5.6在jetty上不能相应文件上传,故未使用-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency>

2:Spring boot jetty支持http、https(ssl、tls)双协议,支持双端口配置
2.1:application.yml配置,配置http的协议端口为5205,配置https的证书文件路径、密码、端口(7205)
server:
# address: 192.168.1.119 #此处不需要配置ip,配置后则会使用hostname访问
port: 5205
context-path: /note5
jetty:
selectors: -1
acceptors: -1
https:
port: 7205
keystore-password: 123456
keystore-file: D:/rsakey/loveshare.keystore
2.2:配置参数绑定bean的属性HttpsProperties
package me.loveshare.note5.properties;
imp