Sergey,
Unless I am missing something, this solution is not thread safe. Is
there a way to have ExceptionMapper instantiated as a prototype bean?
Otherwise I don't see how this will work properly across more than 1
thread. But maybe I am wrong... looking forward to your clarification
:)

Thanks,
Mike

On Thu, Dec 17, 2009 at 4:31 PM, Henrik Martin
<[email protected]> wrote:
> Thanks Sergey. That worked great. Cheers,
>
> /Henrik
>
> On Thu, 2009-12-17 at 09:33 +0000, Sergey Beryozkin wrote:
>> Hi
>>
>> You can have a
>>
>> @Context
>> private UriInfo uriInfo;
>>
>> or
>>
>> private UriInfo uriInfo;
>> @Context
>> public void setUriInfo(UriInfo uriInfo) {...}
>>
>> declared in your mapper class...
>> cheers, Sergey
>>
>> ----- Original Message -----
>> From: "Henrik Martin" <[email protected]>
>> To: <[email protected]>
>> Sent: Thursday, December 17, 2009 12:14 AM
>> Subject: How do I access the request URI from an ExceptionMapper?
>>
>>
>> > Greetings. I have written a bunch of ExceptionMapper implementations to
>> > catch a variety of business exceptions in our system and return them as
>> > a special type of Response object. It works fine, but I need to get a
>> > hold of the URI from the incoming request to set it in the outgoing
>> > Response. Since the ExceptionMapper interface method toResponse() only
>> > gives me the actual Exception that was thrown, is there another way I
>> > can get the URI? Thanks,
>> >
>> > /Henrik
>

Reply via email to