Hi
On 21/07/12 23:56, Benson Margulies wrote:
There's a quirky situation with browsers.

If you want to map a form with a file upload field to an Ajax request,
libraries (such as ExtJS and JQuery) help you out by creating an
iframe. However, at least with ExtJS 4.1, HTTP errors get eaten
somewhere.

So, it's never a good idea to return an HTTP error if you can avoid
it. Instead, the best thing to do (at least with Ext) is to return
success and a blob of JSON that lacks 'success: true'.

Is there a way to install a provider that can map *all* errors,
including things like missing mappings, for this purpose?
Yes, register a custom RuntimeException ExceptionMapper provider. One thing is that custom exceptions with no matching Exception mappers will escape to the servlet container - so you can additionally set an out fault interceptor to catch those, or register a servlet filter

Sergey

Reply via email to