![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java web -spring boot
Zonson9999
但行好事,莫问前程
展开
-
nginx swagger-ui 问题备忘
假设 spring boot 使用的端口为 8888nginx 将请求转至 8888,如下配置会导致 swagger-ui 网页内的请求失效: location / { proxy_pass http://127.0.0.1:8888/; }增加如下一行,可解决问题: location / { proxy_set_header Host $host:$server_port; ...原创 2021-09-11 22:33:55 · 353 阅读 · 0 评论 -
IOFileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly
org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nested exception is java.io.IOException: org.apache.tomcat.util.http.fileupload.impl.IOFileUploadException: Processing of multipart/form-data request failed...原创 2020-10-30 15:10:05 · 4576 阅读 · 2 评论 -
springboot application properties 入门
参看:https://docs.spring.io/spring-boot/docs/2.1.0.RELEASE/reference/htmlsingle/#boot-features-external-config实例:application.properties 写如下值:server.port=9898name=tomController 中读取的代码:@RestCon...原创 2018-11-09 15:36:40 · 122 阅读 · 0 评论 -
springboot application.properties 配置绑定系统环境变量值
将配置值绑定为环境变量的值,写法如${环境变量名: 默认值} 默认值为读不到该环境变量时使用的值可线下开发的时候使用默认值,线上部署的时候配一个环境变量。示例:a_url=${A_URL:http://www.baidu.com/}测试:可修改eclipse 的 run configuration ,在其中设定环境变量,重新运行程序即生效也可以 修改 /etc/profi...原创 2018-11-09 16:30:37 · 10659 阅读 · 0 评论 -
springboot @Value 可以使用变量
常规写法: @Value("${com.xx.account-system-rmi.host}") public String host;如果 com.xx.account-system-rmi.host 多次用到,可以将 com.xx.account-system-rmi.host 定义为常量。优化写法: public static final String R...原创 2018-11-29 09:12:39 · 1047 阅读 · 0 评论 -
spring boot SHA1计算
建议使用 apache commons-codechttps://mvnrepository.com/artifact/commons-codec/commons-codec/1.9<!-- https://mvnrepository.com/artifact/commons-codec/commons-codec --><dependency> <...原创 2018-12-12 16:12:46 · 4740 阅读 · 0 评论 -
使用 eclipse 搭建 spring boot 项目详细步骤
使用 eclipse步骤一: 在 start.spring.io 上生成项目步骤二:解压下载的zip包步骤三:eclipse 导入项目步骤四:maven update右键点选项目,maven->update project。这一步比较耗时步骤五:运行项目右键点选 demoApplication , run as -> java applicat...原创 2019-06-05 15:52:31 · 991 阅读 · 2 评论 -
使用 spring tool suit 搭建 spring boot 项目
使用 eclipse 搭建 spring boot 项目详细步骤相对繁琐。使用 spring tool suit 则简单多了。直接new一个project ,选项 spring starter project 即可。原创 2019-06-05 16:06:00 · 541 阅读 · 0 评论