|
From: Ryan J. M. <ry...@da...> - 2008-08-19 13:09:18
|
Christian,
I'll take a look at these once I wrap up the JAXB/JSON changes which I
hope to complete this week.
Ryan-
On Aug 15, 2008, at 1:42 AM, Christian Bauer wrote:
>
>> Probably the best solution would be to implement ExceptionMapper
>> handling in Resteasy as some kind of filter I could enable/disable/
>> extend.
>
> Some pseudo code to illustrate this, current situation:
>
> // Wrap in RESTEasy contexts
> try {
> ResteasyProviderFactory.pushContext(HttpServletRequest.class,
> request);
> ...
> // Wrap in Seam contexts
> new ContextualHttpServletRequest(request) {
> UriInfoImpl uriInfo = // Do stuff
> dispatcher.getDispatcher().invoke(in, theResponse);
> }
>
> } finally {
> ResteasyProviderFactory.clearContextData();
> }
>
> Ideally I would get access to the ExceptionMapper invocation like
> this, the exception needs to bubble out of dispatcher.invoke():
>
> // Wrap in RESTEasy contexts
> try {
> ResteasyProviderFactory.pushContext(HttpServletRequest.class,
> request);
> ...
> // Wrap in Seam contexts
> new ContextualHttpServletRequest(request) {
> UriInfoImpl uriInfo = // Do stuff
> dispatcher.getDispatcher().invoke(in, theResponse);
> }
> } catch (Exception ex) {
> return exceptionMapper.getResponse(ex);
> } finally {
> ResteasyProviderFactory.clearContextData();
> }
>
> Anything else is going to be significantly more effort to integrate
> into the Seam filter/call stack.
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win
> great prizes
> Grand prize is a trip for two to an Open Source event anywhere in
> the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Resteasy-developers mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
|