Skip to content

rack4java/rack4java-middleware

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rack4Java middleware

Introduction

The original ruby rack implementation has been enhanced by lots of additional “middleware” – self-contained, re-usable chunks of web-application functionality which can easily be composed into rich applications. As an extra bonus, many of the middleware implementations are open source, and so can also be used to learn tips and techniques for creating or improving your own rack middleware.

Rack4Java also supports the same kind of middleware but, being newer and less well-known, has not grown such a full set of resources.

This project is an attempt to “jump start” such an ecosystem by providing Rack4java “clones” of a broad selection of middleware, based on freely-available ruby rack code. There is no intention to claim ownership of the ideas here – each rack4Java middleware links clearly to the code it was based on.

Middleware implementations in this project are as follows:

What it does Rack4Java middleware class(es) Based on
A very simplistic page caching system. The first time a GET for a particular path (with no query parameters etc.) is seen a file is created from the response body. On subsequent requests, the pre-rendered file is returned instead. Note that if the enclosing server automatically serves static content, for example from a “public” directory, then setting the root file to that directory will mean that cached files are served directly by the container; only the first request comes through rack4java. FunkyCache.java github.com/tuupola/rack-funky-cache
A way of associating static files to be served in case of 404 or 500 errors from the application. NaughtyStep.java github.com/mig-hub/naughty_step
Attempt to derive an Accept header by inspecting the “file extension” of the URL leaf. AbstractFormat.java github.com/mynyml/rack-abstract-format
Perform a content-negotiation process on behalf of an application. Deals with multiple types, q priorities and sub-type wild cards for both client and application. FormatNegotiator.java github.com/mynyml/rack-accept-media-types

About

Examples (or clones, if you will) of existing ruby rack middleware converted to rack4java

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages