On Sep 10, 2010, at 11:39, Paul Sandoz wrote:
>> Maybe I'm doing something crazy and misunderstood exception mappers,
>> but I'm trying to do this in the toResponse function of my exception
>> mapper
>>
>> return Response.status(statusCode).entity(errorText).type("text/
>> html").build();
>>
>> which seems to work in that the response is returned and rendered as
>> html, for example, but the status code returned is alwasy OK (200).
>>
>> is this expected and i've missed something?
>>
>No, it is not expected.
I would have thought not, I thought it might be because I'm returning 500 errors, as I've seen this mentioned, but this works now - see below
>The status code returned should be that set by
>the Response.status(statusCode). Do you have a reproducible test case
>you can send me?
I'm trying to build one as we speak, but I can't reproduce it at the minute on my main development box but this is using old versions of jersey and
glassfish (1.1.5& 3.0.1) due to the other issue I'm having with the latest versions, and unfortunately I've also trashed my test box which also exhibited
the issue so can't strip down a working test case from there either...
When I was debugging it before it seemed that the status was lost during the response processing but at the time my jersey sources didn't match the jars (source newer)
so the debugger may have been lying. If I get it to break again i'll post a test case.
John