What is The Bohemia Project?
Bohemia is an umbrella project intended to hold several related packages designed to make it easier for developers to create small-scale web applications.
The Bohemia Philosophy
- If a package is so big and complicated that you can't learn enough in a morning, from cold, to be able to make use of it that afternoon, it's probably too big and complicated. Developers with deadlines rarely have enough time to learn the details of a large package.
- Small packages with well-defined functions are key. If you can learn in one hour the 10% of the package that covers 90% of your needs so that you can make use of the package immediately, that has to be a good thing.
- Extendability is important. Design package cores with abstraction using simple APIs so that new components can be developed quickly and plugged in with a simple configuration change.
What is Ginger?
Ginger is the cornerstone of Bohemia and the first package to be made available. It's an abstract servlet that you subclass to create web applications.
- If you have a small application to develop and you think Struts and JSPs may be a sledgehammer to crack a nut -
- If you don't know JSPs and Struts very well, and you don't have time to learn -
- If you already know Velocity Template Language, or you can spare the hour or two that you'd need to learn all that most people need -
See the links in the sidebar to download the latest version and the Quick Start manual, and to browse the API JavaDocs. The Ginger JAR file contains source and binaries.
Ginger Demo Kit
The Demo kit WAR file is available for download from the Bohemia Project Downloads Page.
The primary purpose of the WAR file is to show the structure of a Ginger application, the sources of command methods and the XML configuration. It can also be installed and run (it was developed and tested under Tomcat 6.0.14). For full details see the relevant section of the Quick Start manual (available from the project download page); to summarize:
- Unpack the WAR file to a convenient directory;
- To build and run the demo, download the Velocity and Ginger JAR files, drop them into the "lib" directory, rebuiild the WAR and deploy;
- Sources are included so that you can see how to write Command methods and the Ginger XML configuration file - see the WEB-INF/src directory.
- See the Ginger Quick Start Manual for more information about the Demo Kit.
The current stable release is v1.3, which was made available for download 13-Dec-2007. It was developed and tested under Java 6 update 3 and Tomcat 6.0.14.
Changes in version 1.3 (13-Dec-2007):
1. The Context class is now deprecated. The name "Context" conflicts with other classes in the Servlet API and other places and was causing confusion and unnecessary complication. It has been replaced with the otherwise identical "Dynamic" class.
1.1 getPresentationContext() and getLogicalContext() have been similarly deprecated and renamed methods created.
2. Better handling of HTTP methods:
2.1 The Ginger Servlet maintains two sets of HttpMethod (enum) objects, one being a set of Allowed HTTP methods, the other a set of Advertised methods. If a request contains a method not in the first list, it is rejected. OPTIONS requests result in responses containing the Advertised set.
2.2 Methods added to allow the subclass to get and set the allowed and advertised HTTP methods.
3. General cleanup:
3.1 Version number for Ginger 1.2 was accidentally left at 1.1 internally. New version is definitely 1.3.
3.2 Slight change in sequence of operations when receiving a new request.
3.3 Fixed a number of compiler warning messages.
3.4 Moved some general-purpose methods into a Util class.
3.5 Logging calls have been moved into a new method that can be called or overridden in the subclass.
Changes in version 1.2 (07-Dec-2007):
1. Added JSP Support
1.1 Required change to TemplateProcessor interface: merge() now requires HttpServletRequest parameter.
1.2 JspProcessor class added.
Changes in version 1.1 (29-Nov-2007):
1. The configuration file can now specify the response MIME type and character encoding when defining Render Commands. To support this:
1.1. The Configurator class has changed to parse "content" and "encoding" attributes for Render commands.
1.2. The RenderCommand class includes the content-type and encoding.
1.3. TemplateProcessor.merge() now expects the HttpServletResponse (instead of a Writer), the content-type and encoding character set.
1.4. The VelocityProcessor class has changed to set content-type and encoding as specified by the changes to the TemplateProcessor interface.
1.5. GingerServlet provides the content-type and encoding to the TemplateProcessor.
2. Render commands can have a "render" attribute (optional, default value is "true"). If this is set "false", the servlet does not perform the rendering step. This allows a Render command to set up for a redirect.
2.1. Configurator modified to accept "render" attribute.
3. Some code and comment cleanup.