Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

JRuby-Rack Examples

This directory includes samples using JRuby-Rack to build Rack web applications for deployment into Java app servers.

  • All use Warbler to do so for easy of packaging.
  • Require JRuby 10.0 and a compatible JVM (Java 21 -> 25).

Building/running

For deployment into a separate webserver:

  1.  rm -f Gemfile.lock && bundle install && bundle exec warble war
  2. Drop the war into a relevant Java app server running a compatible JVM version

As an executable jar within Jetty:

  1.  rm -f Gemfile.lock && bundle install && bundle exec warble executable war
  2.  java -Dwarbler.debug=true -Dwarbler.port=8989 -jar *.war

Demo routes

Example Component Embedded Route Deployed War Route
Rails 7 Status Page http://localhost:8080/up http://localhost:8080/rails7/up
Rails 7 Snoop Dump http://localhost:8989/snoop http://localhost:8080/rails7/snoop
Rails 7 Simple Form submission http://localhost:8989/simple_form http://localhost:8080/rails7/simple_form
Rails 7 Body Posts http://localhost:8989/body http://localhost:8080/rails7/body
Rails 7 JSP (render) http://localhost:8989/jsp/ http://localhost:8080/rails7/jsp/
Rails 7 JSP (forward to) http://localhost:8989/jsp-forward/ http://localhost:8080/rails7/jsp-forward/
Rails 7 JSP (include) http://localhost:8989/jsp-include/ http://localhost:8080/rails7/jsp-include/
Sinatra Demo Index http://localhost:8989/ http://localhost:8080/sinatra
Sinatra Info http://localhost:8989/info http://localhost:8080/sinatra/info
Sinatra Snoop Dump http://localhost:8989/env http://localhost:8080/sinatra/env
Sinatra JSP (render) http://localhost:8989/jsp/index.jsp http://localhost:8080/sinatra/jsp/index.jsp
Sinatra JSP (forward to) http://localhost:8989/jsp_forward http://localhost:8080/sinatra/jsp_forward
Sinatra JSP (include) http://localhost:8989/jsp_include http://localhost:8080/sinatra/jsp_include
Sinatra Streaming Demo http://localhost:8989/stream http://localhost:8080/sinatra/stream
Camping Demo Index http://localhost:8989/ http://localhost:8080/camping
Camping Snoop Dump http://localhost:8989/snoop http://localhost:8080/camping/snoop

Development

You can run the examples using local source for warbler or jruby-rack by

  • Uncommenting the relevant path: suffixes in the example Gemfiles.
  • (For Warbler) Build from source first, since its booting jar files are not committed to source
  • (For jruby-rack) Build from source first, since it does not define a gemspec