Hi
On 04/05/12 16:59, yann777 wrote:
Hello,

I use CXF 2.3.1 and I would like to change the response status from a
Response.
What I like to do exactly is to have an http 303 status for my response
(redirection), using an interceptor, instead of the response status sent by
my endpoint.
I saw that it was not possible to make it using an interceptor placed before
JAXRSOUTInterceptor, but I tried doing it by placing my interceptor after
it.
What happens is that when I change the "Message.RESPONSE_CODE" it gets
updated well, but the "real" response status I get is http 200.
Do you have any idea about the problem? is it possible to change the
Response status from interceptors?

Any advice will be greatly appreciated, thx.


I was about to advice using ResponseHandler but then spotted the P.S :-), why would not you want to use them ? It's pretty cheap to duplicate Response there. I think setting the status code after the JAXRSOutInterceptor does not work because the HttpHeaders code at the HTTP out level has already propagated the status code and the headers.

Perhaps setting the custom code before JAXRSOutInterceptor should work better, ex, if the value is not 200 than prefer it to whatever Response provides...

Cheers, Sergey

Yann

ps: I reall want to do this through interceptors and not by using custom
ResponseHandler


--
View this message in context: 
http://cxf.547215.n5.nabble.com/JAXRS-Changing-Response-status-using-interceptors-tp5686288.html
Sent from the cxf-user mailing list archive at Nabble.com.


--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to