Dynamic Goodness: JRuby + Spring + Struts 2

Recently I’ve completed an ideas swimming in my head for awhile now… using ruby within the java world. And it couldn’t be easier thanks to Struts 2, Spring, and JRuby. ;)

All you need is to use Spring’s Scripted Beans, define an interface for your action so it translates well to java, and just reference the bean id in your struts 2 configuration.

That’s it… from the jsp point of view you just ignore the implementation and use methods exposed via the interface. in the code behind the scenes you don’t even know you’re using java… since everything maps back to the action and the action is written in ruby, all of your application code is written in ruby. ;)

I’ll follow up with more on this soon… I must say it’s slightly exciting to open a *.rb file in my project’s WEB-INF directory, modify it, refresh my web page and see my changes instantly versus a long drawn out recompile/redeploy. :-D

You can leave a response, or trackback from your own site.

Facebook comments:

One Response to “Dynamic Goodness: JRuby + Spring + Struts 2”

  1. Mike Finney says:

    The rapid feedback your solution provides is awesome!

Leave a Reply

Subscribe to RSS Feed Follow me on Twitter!