Skip to content

Servlet Integration

Karol Bucek edited this page Feb 28, 2014 · 2 revisions

Request

  • Servlet request attributes are passed through to the Rack environment.
  • Rack environment variables and headers can be overridden by Servlet request attributes.

TODO more documentation needed

Rack Environment

  • the context is accessible to any application both through the global variable $servlet_context and the Rack environment variable env['java.servlet_context']
  • the underlying Servlet request object is available in the Rack environment via the java.servlet_request key
  • similarly, the native response object is available via the java.servlet_response environment Hash key

TODO more documentation needed

Servlet Sessions

A Rack compatible JavaServletStore is provided which can be used as an alternative session store.

All session attributes with String keys and String, Numeric, boolean or (java) object values are automatically copied to the Servlet session. Please note that the Servlet session is created on demand (unless your server documentation states otherwise), thus similar to how Rack/Rails works if you do not touch any session[] data it won't be accessed.

Clone this wiki locally