Download the WEB4J Example Application
The main web4j download includes :
- the web4j.jar binary, which implements the WEB4J framework
- an extensive example application which demonstrates how to use web4j.jar
The web4j.jar binary is included in the example application (and in the tutorial) at this location :
/WEB-INF/lib/web4j.jar
The name of the example application is Fish & Chips Club. It allows a group of friends to meet regularly for lunch. It serves as an informal "reference implementation", and exercises about 95% of the WEB4J API.
The 'look' of the Fish & Chips Club is simple - too simple for most real applications. It's important to note that WEB4J is a Java API, and it has little to say about the appearance of your web app. That is, you use Cascading Style Sheets to control your app's appearance - not WEB4J.
To install Fish & Chips Club, please follow closely the guidelines of the Getting Started Guide.
This example application is not small. Those less experienced with Servlets will greatly benefit from first going through the tutorial. There's also a second example application called Predictions. It's significantly smaller than the Fish & Chips Club. Many will find it better for learning. It can be downloaded at the bottom of this page.
In general, WEB4J applications can interact with any relational database. The Fish & Chips Club example application uses MySQL. A script is provided for the creation and population of the database.
System requirements are :
- JDK 1.5+
- Servlets 2.4+ (Tomcat 5.5, for example)
- JSP 2.0+
The Fish & Chips Club javadoc includes convenient links to source code, JSPs, and SQL statements. The source code is syntax-highlighted to make it easier to read.
The Fish & Chips Club includes several modules :
- a main business domain
- webmaster tools - diagnostics, logging settings, performance stats
- user preferences - changing language, changing passwords
- access control - adding users, changing roles, resetting passwords
- translation - adding and editing translations for user interface text
The Fish & Chips Club example application is provided as both a starting point and guide. It is recommended, though not required, that your applications be created by starting with the example, and changing it gradually. If any items are undesired, then they are simply removed by deleting directories (and any links from menus). This is only possible because of the package-by-feature style recommended by WEB4J. (See the User Guide for more information.)
This approach is consistent with the following :
- destroying things is easiest of all
- next, changing something that already exists is usually easier than starting with nothing
- finally, starting with nothing usually takes the most time
In any case, the classes in the example application are always effective guides.
License
Like WEB4J itself, the source code of the example applications is released under the BSD open source license.
Other Downloads
The following downloads are also available :- Fish & Chips Club Javadoc.zip
- Predictions Source Code. This is a second example application. It's somewhat simpler than the Fish & Chips Club.
- Predictions Javadoc.zip
- WEB4J Javadoc.zip
- WEB4J Dev Tools
- WEB4J Jar File (already included in the tutorial and example applications)
- WEB4J Source Code, released under a BSD License. The source files use UTF8 encoding. If you compile the source, you may need to specify UTF8 as the file encoding.