资源说明:Examples (or clones, if you will) of existing ruby rack middleware converted to rack4java
h1. Rack4Java middleware h2. 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. h2. 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":https://github.com/rack4java/rack4java-middleware/blob/master/src/main/java/org/rack4java/middleware/funky_cache/FunkyCache.java | "github.com/tuupola/rack-funky-cache":https://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":https://github.com/rack4java/rack4java-middleware/blob/master/src/main/java/org/rack4java/middleware/naughty_step/NaughtyStep.java | "github.com/mig-hub/naughty_step":https://github.com/mig-hub/naughty_step | | Attempt to derive an Accept header by inspecting the "file extension" of the URL leaf. | "AbstractFormat.java":https://github.com/rack4java/rack4java-middleware/blob/master/src/main/java/org/rack4java/middleware/abstract_format/AbstractFormat.java | "github.com/mynyml/rack-abstract-format":https://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":https://github.com/rack4java/rack4java-middleware/blob/master/src/main/java/org/rack4java/middleware/format_negotiator/FormatNegotiator.java | "github.com/mynyml/rack-accept-media-types":https://github.com/mynyml/rack-accept-media-types |
本源码包内暂不包含可直接显示的源代码文件,请下载源码包。