springboot
文章平均质量分 57
@ chen
这个作者很懒,什么都没留下…
展开
-
Java | 使用HttpClient发送网络请求
使用HttpClient发送网络请求使用HttpClient发送get或post请求,访问网络资源。一、添加maven依赖在解析数据时往往会配合json使用,所以同时添加fastjson依赖。<dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.5.原创 2022-03-24 23:25:54 · 2043 阅读 · 0 评论 -
springboot 关于“No converter found for return value of type: class xxxx“的解决方法
springboot 关于"No converter found for return value of type: class xxxx"的解决方法在springboot中,我们通常会封装一个响应类用来统一响应的数据格式。该错误发生于服务器响应请求时,对返回数据的转换阶段。1. 发生场景controller中使用@RestController注解返回自定义的对象时,正常来讲springboot会自动将该对象转成json格式,但是请求时报错No converter found for retu原创 2022-03-24 17:48:32 · 1424 阅读 · 0 评论 -
springboot日志配置logback-spring.xml
springboot日志配置logback-spring.xml日志配置文件logback-spring.xml放在项目src/main/resources目录下<?xml version="1.0" encoding="UTF-8"?><!-- logback默认每60秒扫描该文件一次,如果有变动则用变动后的配置文件。 --><configuration scan="false"> <!-- =========================原创 2022-03-23 23:30:35 · 798 阅读 · 0 评论 -
springboot使用maven插件打包项目
springboot使用maven插件打包项目springboot将项目打包成jar包时,默认会将所有依赖都打包进去,这样使得打包后的jar包十分庞大。可以通过配置maven插件来打包项目,将资源文件和依赖文件以及代码文件分离开。这样在依赖文件没有变动的情况下,后续只需要更新打包后的不含依赖的项目代码jar包即可。1. 涉及插件maven-resources-plugin | 处理资源文件maven-dependency-plugin | 处理依赖文件maven-jar-plugin | 打包原创 2022-03-23 22:50:08 · 2221 阅读 · 0 评论 -
springboot在application.properties中注入value,list和map
配置文件在配置文件中配置需要注入的值。#单个值val=10#Listlist=1,2,3,4#Mapmap={'name':'chen', 'age':'12', 'sex':'男'}注解使用@PropertySource注解标明配置文件路径,同时引入多个配置文件可使用@PropertySources注解@PropertySource(value = {"classpath:application-left.properties"})@PropertySources({@Prope原创 2021-01-08 15:27:36 · 1780 阅读 · 0 评论