|
From: Gregor J. <gr...@ja...> - 2013-05-28 13:13:42
|
Hi there, something that is bugging me for quite some time since using resteasy is setting the http code in the response. In my scenario I would like to create a resource by invoking a POST request. After creating the resource I would like to return a 201 (created) to the client as well as a Location URI pointing to the newly created resource. I set the 201 by injecting the HttpResponse. Unfortunately, resteasy ignores my set value an puts a 204 (No Content) instead, since the POST method's return type is void. Back in 2.3.* I was able to achieve this by overriding the value set by resteasy in a PostProcessInterceptor. Since this is deprecated now - what other options do I have? I am aware that I could build the Response object and return it - but this is not a clean interface definition in my opinion, since one couldn't see what's coming back only by looking at the return value of the interface. Is there any way to set the http code without returning the Response object? Thanks, Gregor -- Ing. Gregor Jarisch entrepreneurship & development |