JRuby Rack - How to add a servlet filter?

I’m trying (with no success) to pass the response of a JRuby Rack -
Rails application to a filter in order to get it processed. Basically I
want to use the Orbeon XForm Engine to enhance the XHTML output coming
from my Rails application. If I use a simple Java servlet instead on
JRuby Rack everything works smoothly.

Here’s the web.xml file: web.xml · GitHub

Do you have any thoughts?
Thanks in advance!

Sandro.