|
From: Christian B. <chr...@gm...> - 2008-08-15 05:43:02
|
> 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.
|