[Jruby-extras-devel] Scaffolding now works, how bout access to ServletContext?
superchrisnelson at gmail.com
Sun Jan 28 23:54:03 EST 2007
WIth the latest fixes in jruby trunk I am now able to successfully run
my scaffold sample under jetty. I changed the dependency to point at
jruby-complete instead of jruby and that seemed to work just fine. I
am still using the gems from JRUBY_HOME for now. It's quite nice to
bring up the app in servlet container using mvn jetty:run and see it
work. The only remaining issue is that the very first time I hit an
error dealing a line in the scaffolded page:
<%= flash[:notice] %>
If I reload the page it works fine. I'm assuming there is some
wierdness with flash not existing yet for the first request. Anyone
have a good idea what it might be?
Anyways this is still excellent progress, dates are now working, and
performance is looking quite good. I can change controller code,
reload the page and see the changes without bouncing jetty, which is
fantastic and will be very impressive in a demo.
My next goal would be to start playing with Spring integration, but to
do that I will first need access to the ServletContext from a
controller. I'd like to get others opinions on the best way to expose
it. One relatively simple way would be to have it passed along into
the Rails AbstractRequest during dispatch and be acessed as a property
of the request from controllers. Does this sound at all reasonable?
Does anyone have a better idea? I think I could implement this fairly
simply if we decide to go this route.
More information about the Jruby-extras-devel