Modified: trunk/rails-integration/src/main/java/org/jruby/webapp/RailsServlet.java (653 => 654)
--- trunk/rails-integration/src/main/java/org/jruby/webapp/RailsServlet.java 2007-06-22 14:26:11 UTC (rev 653)
+++ trunk/rails-integration/src/main/java/org/jruby/webapp/RailsServlet.java 2007-06-22 14:39:26 UTC (rev 654)
@@ -73,12 +73,9 @@
protected void dispatchRequest(Ruby runtime, HttpServletRequest request, HttpServletResponse response) throws Exception {
RubyIO stdin = new RubyIO(runtime, request.getInputStream());
- RubyIO stdout = new RubyIO(runtime, new HttpOutput(response));
+ RubyIO output = new RubyIO(runtime, new HttpOutput(response));
runtime.defineVariable(new org.jruby.runtime.GlobalVariable(runtime, "$stdin", stdin));
- runtime.defineVariable(new org.jruby.runtime.GlobalVariable(runtime, "$stdout", stdout));
- runtime.defineVariable(new org.jruby.runtime.GlobalVariable(runtime, "$>", stdout));
- runtime.defineVariable(new org.jruby.runtime.GlobalVariable(runtime, "$defout", stdout));
// setup the environment
setupEnvironment(runtime, request);
@@ -98,8 +95,8 @@
if (dispatcher == null) throw new ServletException("The rails dispatcher could not be found");
// dispatch the request
- Object[] args = { cgi };
- JavaEmbedUtils.invokeMethod(runtime, dispatcher, "dispatch", args, void.class);
+ IRubyObject[] args = { cgi, ((RubyModule)((RubyModule)((RubyModule)(runtime.getModule("ActionController")).getConstant("CgiRequest")))).getConstant("DEFAULT_SESSION_OPTIONS"), output};
+ dispatcher.callMethod(runtime.getCurrentContext(), "dispatch", args);
}
protected IRubyObject createCgi(Ruby runtime) {