【发布时间】:2016-11-20 10:46:02
【问题描述】:
我在 Spring-Boot 技术的帮助下开发了 1-REST Web 服务。
现在,当我要请求任何东西时,它没有以 JSON 格式响应我?取而代之的是它以简单的“字符串”格式响应。
另外,请注意我在 Controller 类级别使用了注解 @RestController。
我在想一些我缺少的配置。是这样吗?
我当前的 Maven 配置是,
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.6.RELEASE</version>
</parent>
另外,我注意到,当我请求(POST)获取列表时,在这种情况下它会返回一个 JSON 对象数组。
谁能指导我怎么了?
【问题讨论】:
-
您能提供您的控制器代码吗?
标签: spring spring-mvc spring-boot jackson spring-boot-maven-plugin