CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Mon, 18 Aug 2025 13:37:46 GMT
content-type: text/html; charset=utf-8
content-length: 117
x-archive-orig-server: nginx/0.6.26
x-archive-orig-date: Sat, 20 Sep 2008 04:29:16 GMT
x-archive-orig-connection: close
x-archive-orig-status: 302 Found
location: https://web.archive.org/web/20080920042916/https://github.com/nicksieger/jruby-rack/tree/master
x-archive-orig-x-runtime: 0.13350
x-archive-orig-cache-control: no-cache
x-archive-orig-content-length: 117
cache-control: max-age=1800
memento-datetime: Sat, 20 Sep 2008 04:29:16 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Fri, 25 Jul 2008 08:09:07 GMT", ; rel="prev memento"; datetime="Fri, 25 Jul 2008 08:09:07 GMT", ; rel="memento"; datetime="Sat, 20 Sep 2008 04:29:16 GMT", ; rel="next memento"; datetime="Tue, 03 Mar 2009 11:09:45 GMT", ; rel="last memento"; datetime="Sat, 19 Sep 2009 11:18:56 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_5_20080920015354_crawl109-c/52_5_20080920042714_crawl103.arc.gz
server-timing: captures_list;dur=0.945054, exclusion.robots;dur=0.027549, exclusion.robots.policy;dur=0.012457, esindex;dur=0.017108, cdx.remote;dur=559.088003, LoadShardBlock;dur=888.125911, PetaboxLoader3.datanode;dur=469.047172, PetaboxLoader3.resolve;dur=259.222634, load_resource;dur=281.230148
x-app-server: wwwb-app221
x-ts: 302
x-tr: 1823
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
set-cookie: wb-p-SERVER=wwwb-app221; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Mon, 18 Aug 2025 13:37:46 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.6.26
x-archive-orig-date: Sat, 20 Sep 2008 04:29:16 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-x-runtime: 0.08559
x-archive-orig-etag: "8598567429362ffedee0a0eb0164e7a6"
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-orig-content-length: 21240
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Sat, 20 Sep 2008 04:29:16 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Sat, 13 Sep 2008 10:33:40 GMT", ; rel="prev memento"; datetime="Sat, 13 Sep 2008 10:33:40 GMT", ; rel="memento"; datetime="Sat, 20 Sep 2008 04:29:16 GMT", ; rel="next memento"; datetime="Sat, 27 Dec 2008 21:07:00 GMT", ; rel="last memento"; datetime="Thu, 17 Sep 2009 08:23:01 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_5_20080920015354_crawl109-c/52_5_20080920042714_crawl103.arc.gz
server-timing: captures_list;dur=0.558887, exclusion.robots;dur=0.018174, exclusion.robots.policy;dur=0.008510, esindex;dur=0.010192, cdx.remote;dur=52.863350, LoadShardBlock;dur=405.849775, PetaboxLoader3.datanode;dur=207.193108, PetaboxLoader3.resolve;dur=355.503114, load_resource;dur=237.011196
x-app-server: wwwb-app221
x-ts: 200
x-tr: 743
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
nicksieger's jruby-rack at master — GitHub
This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (

This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (

Description: | Rack for JRuby and Java appservers |
Homepage: | https://wiki.jruby.org/wiki/JRuby_Rack |
Clone URL: |
git://github.com/nicksieger/jruby-rack.git
Give this clone URL to anyone.
git clone git://github.com/nicksieger/jruby-rack.git
|
Search Repo: |

nsieger (author)
Fri Sep 19 06:32:59 -0700 2008
name | age | message | |
---|---|---|---|
![]() |
.gitignore | ||
![]() |
History.txt | Tue Aug 26 21:25:39 -0700 2008 | History.txt made current for 0.9.1 and 0.9.2 re... [nsieger] |
![]() |
LICENSE.txt | Tue Apr 15 11:22:21 -0700 2008 | Change license to MIT [nsieger] |
![]() |
README.txt | Fri May 16 20:56:32 -0700 2008 | Updated README with a few extras from the wiki [nsieger] |
![]() |
TODO | Mon May 19 08:24:13 -0700 2008 | Added a couple more items to TODO [nsieger] |
![]() |
build.xml | Tue Dec 11 08:08:08 -0800 2007 | Add NetBeans project and build file [nsieger] |
![]() |
buildfile | Fri Aug 29 14:56:00 -0700 2008 | Updating version to 0.9.3-SNAPSHOT [nsieger] |
![]() |
examples/ | Thu Sep 18 18:01:26 -0700 2008 | Change Camping example to use config.ru [nsieger] |
![]() |
nbproject/ | Tue May 20 11:34:41 -0700 2008 | Gah. NB goo changes every time I reshuffle the ... [nsieger] |
![]() |
src/ |
README.txt
JRuby-Rack is a lightweight adapter for the Java servlet environment that allows any Rack-based application to run unmodified in a Java servlet container. JRuby-Rack supports Rails, Merb, as well as any Rack-compatible Ruby web framework. For more information on Rack, visit https://rack.rubyforge.org. = Features == Servlet Filter JRuby-Rack's main mode of operation is as a servlet filter. This allows requests for static content to pass through and be served by the application server. Dynamic requests only happen for URLs that don't have a corresponding file, much like many Ruby applications expect. == Goldspike-compatible Servlet JRuby-Rack includes a stub RailsServlet and recognizes many of Goldspike's context parameters (e.g., pool size configuration), making it interchangeable with Goldspike, for convenience of migration. One caveat is that static content is served by Rack, which requires acquisition of a JRuby runtime. Your throughput with static files will be much lower than when JRuby-Rack is configured as a servlet filter. You have been warned! == Servlet environment integration - Servlet context is accessible to any application both through the global variable $servlet_context and the Rack environment variable java.servlet_context. - Servlet request object is available in the Rack environment via the key java.servlet_request. - Servlet request attributes are passed through to the Rack environment. - Rack environment variables and headers can be overridden by servlet request attributes. - Java servlet sessions are used as the default session store for both Rails and Merb. Session attributes with String keys and String, numeric, boolean, or java object values are automatically copied to the servlet session for you. == Rails Several aspects of Rails are automatically set up for you. - The Rails controller setting ActionController::Base.relative_url_root is set for you automatically according to the context root where your webapp is deployed. - Rails logging output is redirected to the application server log. - Page caching and asset directories are configured appropriately. == Merb == JRuby Runtime Management JRuby runtime management and pooling is done automatically by the framework. In the case of Rails, runtimes are pooled. For Merb and other Rack applications, a single runtime is created and shared for every request. = Building Ensure you have JRuby with the buildr and rack gems installed. jruby -S gem install buildr rack Checkout the JRuby Rack code and cd to that directory svn co https://svn.codehaus.org/jruby-contrib/trunk/rack cd rack Resolve dependencies, compile the code, and build the jar file. jruby -S buildr package The generated jar should be located here: target/jruby-rack-*.jar. == Rails Step-by-step This example shows how to create and deploy a simple Rails app using the embedded Java database H2 to a WAR using Warble and JRuby Rack. JRuby Rack is now included in the latest release of Warbler (0.9.9), but you can build your own jar from source and substitute it if you like. Install Rails and the driver and ActiveRecord adapters for the H2 database: jruby -S gem install rails activerecord-jdbch2-adapter Install Warbler: jruby -S gem install warbler Make the "Blog" application jruby -S rails blog cd blog Copy this configuration into config/database.yml: development: adapter: jdbch2 database: db/development_h2_database test: adapter: jdbch2 database: db/test_h2_database production: adapter: jdbch2 database: db/production_h2_database Generate a scaffold for a simple model of blog comments. jruby script/generate scaffold comment name:string body:text Run the database migration that was just created as part of the scaffold. jruby -S rake db:migrate Start your application on the Rails default port 3000 using Mongrel/ and make sure it works: jruby script/server Generate a custom Warbler WAR configuration for the blog application jruby -S warble config Generate a production version of the H2 database for the blog application: RAILS_ENV=production jruby -S rake db:migrate Edit this file: config/warble.rb and add the following line after these comments: # Additional files/directories to include, above those in config.dirs # config.includes = FileList["db"] config.includes = FileList["db/production_h2*"] This will tell Warble to include the just initialized production H2 database in the WAR. Continue editing config/warble.rb and add the following line after these comments: # Gems to be packaged in the webapp. Note that Rails gems are added to this # list if vendor/rails is not present, so be sure to include rails if you # overwrite the value # config.gems = ["activerecord-jdbc-adapter", "jruby-openssl"] # config.gems << "tzinfo" # config.gems["rails"] = "1.2.3" config.gems << "activerecord-jdbch2-adapter" This will tell Warble to add the JDBC driver for H2 as well as the ActiveRecord JDBC and JDBC-H2 adapter Gems. Now generate the WAR file: jruby -S warble war This task generates the file: blog.war at the top level of the application as well as an exploded version of the war located here: tmp/war. The war should be ready to deploy to your Java application server. = Thanks - Dudley Flanders, for the Merb support - Robert Egglestone, for the original JRuby servlet integration project, Goldspike - Chris Neukirchen, for Rack - Sun Microsystems, Nick's employer, for project support - Last, but not least, Flannery, Nick's wife, for patience and understanding
This feature is coming soon. Sit tight!