Hi!
I am wondering if I can combine ETag support and the subresource concept of
CXF.
The problem I have is, that for supporting ETags I have to return an
Response object, if the user is doing a GET on my object.
Example:
@GET // necessary but death of subresources
@Path("/object/id/{id}")
public Response getObject(@PathParam("id") String id, @Context Request
request)
{
MyObject result = new MyObject().initializeById(id);
EntityTag eTag = new EntityTag(result.getEtag());
ResponseBuilder builder = request.evaluatePreconditions(eTag);
if (builder != null) {
return builder.build();
}
return Response.ok(result).build();
}
But if I return a response object, I am not able to use the concept of
subresources, because for this my method needs to return the object itself
and not a Response containing an entity of the object.
Is there a way to use both concepts? If I just remove the @GET in the
example above, cxf trys to do subresource calls at the response object.
Cheers,
Andreas
--
Andreas Sahlbach