浙江省高等学校教师教育理论培训

微信搜索“教师资格证岗前培训”小程序

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Deploy JRuby web application with jetty-rackup

Deploy JRuby web application with jetty-rackup

Powered by Jetty

I already reported about our problems with different Ruby libraries. Bad library support is the main cause, why in our current project we decided to switch from MRI to JRuby for all the new application development.

The tradition in the JRuby world is to do it the same way it is done in Java:

  • create a lengthy configuration in WEB-INF/web.xml
  • package everything to jars and wars
  • throw it in a servlet container - tomcat, jetty or glassfish

and all the howtos and tutorials assume that way.

The Ruby way, in my opinion, is to use Rack and a rackup script. So I wanted to “invert the control” and embed a Java web server inside my Ruby script. That way is also supported by the Java’s light weight web server jetty.

So I ported rackup and adapted it for the usage with jetty. You can install it from github. Now you can take your existing, say Sinatra, application and reuse your existing config.ru

Enjoy!

posted on 2012-03-14 10:54  lexus  阅读(182)  评论(0编辑  收藏  举报