小编jgr*_*jgr的帖子

Intellij IDEA Debugger未在列表中显示null元素

我有第一个元素为null的列表.Intellij调试器将有效大小编号显示为:5,但它仅显示1,2,3,4个元素.很高兴看到索引为0的元素为null(我花了一些时间在调试时弄清楚我的问题,因为它没有显示).是否有可能强制intellij显示这个?

这是屏幕,其中大小为5,元素仅为1-4,因为first为null. 在此输入图像描述

debugging intellij-idea

22
推荐指数
1
解决办法
4118
查看次数

具有XML支持的Spring Boot REST

我使用Spring Boot 1.2.5创建了一个简单的REST Web服务,它适用于JSON,但我不能让这个工作返回XML.

这是我的控制器:

@RestController
..
@RequestMapping(method = RequestMethod.GET,  produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE})
@ResponseStatus(HttpStatus.OK)
public List<Activity> getAllActivities() {
    return activityRepository.findAllActivities();
}
Run Code Online (Sandbox Code Playgroud)

当我调用它时,Accept: application/json一切正常,但当我尝试时,application/xml我得到一些带有406错误和消息的HTML:

The resource identified by this request is only capable of generating responses 
with characteristics not acceptable according to the request "accept" headers.
Run Code Online (Sandbox Code Playgroud)

我的模型对象:

@XmlRootElement
public class Activity {

    private Long id;
    private String description;
    private int duration;
    private User user; 
    //getters & setters...
}

@XmlRootElement
public class User {

    private String name; …
Run Code Online (Sandbox Code Playgroud)

xml rest spring jaxb spring-boot

7
推荐指数
1
解决办法
2万
查看次数

标签 统计

debugging ×1

intellij-idea ×1

jaxb ×1

rest ×1

spring ×1

spring-boot ×1

xml ×1