views:

219

answers:

1

How can I configure tomcat to handle .rhtml pages with jruby?

I guess I should mess around with the web.xml file, but I don't know how...

(ideally, without rails, just the necessary stuff to use erb for rendering rhtml pages...)

+2  A: 

There might be simpler ways, but here are a few ideas :-

  1. Use JRuby-Rack in combination with one of the more lightweight Rack-compatible Ruby web frameworks like Sinatra. Warbler might be useful in wrapping up the application into a .war file for simple deployment to Tomcat.

  2. If you are using Apache in front of Tomcat, you could use a Ruby CGI script to interpolate the .rhtml files.

  3. If the .rhtml files can be interpolated before being deployed (i.e. they do not rely on variables only available at run-time), you could use a framework like Webby and then just serve them as static files.

floehopper
hey, floehopper, thanks for your reply... I did the same a couple of days agos with gsp (groovy server pages) and I just had to add a couple of entries to tomcat's web.xml file... I asume there is solution as easy as that for jruby... right? I'll try what you told me and then I'll tell, thanks...
opensas
There may be a solution as easy as that, but I haven't seen it.
floehopper