Attached is a very ugly patch containing a CGI servlet and some JRuby hacks to support it. It seems to work pretty well, though Rails' use of the Ruby cgi library causes it to output headers to the output stream. We'd need to catch those and parse them to handle them properly through the servlet APIs. This also hardcodes the request and a number of other CGI vars, but it's a good proof-of-concept.
Comments are welcome. I don't intend to carry this further right now, preferring to focus on getting CGI session working in Rails so we can run it without modification. We'll also want to analyze the hacks and see if there are better ways to do them (and there most certainly are).
I'll leave it up for the evening if anyone wants to hit it and see for themselves. It will be easier to work on the CGI stuff using the Apache+CGI method anyway. Notice the HTTP headers getting tacked on the beginning, and if you get an error just reload...it seems something the servlet engine is doing causes an occasional error (probably because of the way I'm allocating runtimes, or because it's adopting a different thread).
http://www.headius.com:8080/rails_info/properties
--
Charles Oliver Nutter @ headius.blogspot.com
JRuby Developer @ jruby.sourceforge.net
Application Architect @ www.ventera.com
super_gross_cgi_servlet.patch
Description: Binary data