这是我的终点
@PUT
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("/{id}")
public Response replace(@PathParam("id") String id,
@Valid WriteCommand replacePersonCommand) {
....
}
这是我的WriteCommand
public class WriteCommand Command {
@NotNull
private String name;
public String getName() {
return name;
}
public void setName(String name) {
LOG.info(">>setName()");
this.name = name;
}
@Context HttpHeaders httpHeaders;
public HttpHeaders getHttpHeaders() {
return httpHeaders;
}
public void setHttpHeaders(HttpHeaders httpHeaders) {
this.httpHeaders = httpHeaders;
}
}
但是从不注入httpHeaders吗?有什么原因吗?
谢谢