HttpServletRequest from ActionDispatch::Request


I’m developing a Rails 3.1 application on JRuby 1.6.7 that interacts
with a
legacy Java-based application. Inside ApplicationController
:before_filter, I need to authenticate with the legacy codebase by
calling a method that requires an argument of type

What’s the best way to create an HttpServletRequest from an

I spent some time searching online but nothing I’ve tried so far has
worked. I’ve tried passing the unmodified ActionDispatch::Request, as
well as request.to_java. I also tried
request.env[‘java.servlet_request’] (which doesn’t seem to exist

Any advice is appreciated - thanks in advance.