相关疑难解决方法(0)

使用Spring Data REST,为什么@Version属性成为ETag并且不包含在表示中?

在Spring Data REST(通过Spring Boot 1.3.3)中,当我GET是资源集合时people,该@Version属性不包含在资源中:

$curl -v http://localhost:8080/api/people/1
*   Trying ::1...
* Connected to localhost (::1) port 8080 (#0)
> GET /api/people/1 HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.42.1
> Accept: */*
> 
< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< ETag: "0"
< Last-Modified: Tue, 26 Apr 2016 00:08:12 GMT
< Content-Type: application/hal+json;charset=UTF-8
< Transfer-Encoding: chunked
< Date: Tue, 26 Apr 2016 00:12:56 GMT
< 
{
  "id" : 1,
  "createdDate" : {
    "nano" …
Run Code Online (Sandbox Code Playgroud)

rest spring spring-data spring-data-rest spring-boot

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