rubytomcatjrubyerbrhtml

how to configure tomcat to handle rhtml pages using jruby?


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...)


Solution

  • 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.