有些情况接口需要返回的是xml数据,在springboot中并不需要每次都转换一下数据格式,只需做一些微调整即可。
新建一个springboot项目,加入依赖jackson-dataformat-xml,pom文件代码如下:
<?xml version="1.0" encoding="UTF-8"?>4.0.0 com.dalaoyang springboot_xml 0.0.1-SNAPSHOT jar springboot_xml springboot_xml org.springframework.boot spring-boot-starter-parent 1.5.9.RELEASE UTF-8 UTF-8 1.8 org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-devtools runtime org.springframework.boot spring-boot-starter-test test com.fasterxml.jackson.dataformat jackson-dataformat-xml org.springframework.boot spring-boot-maven-plugin
售后响应及时
7×24小时客服热线数据备份
更安全、更高效、更稳定价格公道精准
项目经理精准报价不弄虚作假合作无风险
重合同讲信誉,无效全额退款