@CookieParam and @HeaderParam Annotations
There two annotations are related to the internal of HTTP, you don’t see these parameters in the URIs: cookies and HTTP headers @CookieParam extracts the value of a cookie, while @HeaderParam extracts the value of a header field.
@Path("/item")
@Produces(MediaType.TEXT_PLAIN)
public class ItemRestService {
@GET
public String getSessionID(@CookieParam("sessionID") String sessionID) {
}
@GET
public String getUserAgent(@HeaderParam("User-Agent") String userAgent) {
}
}
Ref: Beginning JavaEE7