I have the merhod annotated with @GET. But when here comes HEAD request, it is handled with this method. And in the body of the method I get request type HEAD from HttpRequest object. Why does GET method responces for HEAD requesrs?
[...] By default the JAX-RS runtime will automatically support the methods HEAD and OPTIONS, if not explicitly implemented. For HEAD the runtime will invoke the implemented GET method (if present) and ignore the response entity (if set) [...]
And that is the reason for the behavior you are seeing.
https://jersey.github.io/documentation/latest/jaxrs-resources.html#d0e2129