Predictions - a WEB4J Example Application


Packages Code Tables for the application.
hirondelle.predict.main.deleteaccount Delete all information related to an account.
hirondelle.predict.main.lists Named lists of predictions.
hirondelle.predict.main.logoff Log off the application, and terminate the session.
hirondelle.predict.main.prediction List and edit individual predictions.
hirondelle.predict.main.preferences Allow user to change their preferences. Serve the content of a Prediction List in JavaScript Object Notation (JSON). Reacts to successful user login by invoking Login. Let the user change their password, without knowing their current password. Register a new user. Allow the user to reset their own password, without requiring them to enter the old password. Allow anyone to search the text of predictions, looking for matches to text they provide. View a single list of predictions.
hirondelle.predict.util Utility classes used across more than one feature.
hirondelle.web4j.config Concrete implementation classes for interfaces defined by WEB4J.


Predictions - a WEB4J Example Application

This is an example application, authored by John O'Hanley. It demonstrates using WEB4J to build a typical Java web application : a person using a browser to interact with a relational database.

The application has a style typical for a public web application: users can register themselves, and maintain their own accounts. As well, security rules are enforced which prevent one user from changing the data attached to another user. (For internal intranet applications, security is usually centered on roles, not individual users.)

The problem domain is about making simple predictions, and tracking their outcome. Anyone can browse the predictions. To enter predictions, users must first create an account.

To run this application, please see the Getting Started Guide. Although that guide was created for another example application (the Fish and Chips Club), it is largely applicable to this application as well. The main difference is that this application has just a single database, not many.


Features specific to the Predictions application include :


Note that package-by-feature is used. This is the recommended style, though it is not required. (If you have never used package-by-feature, you are encouraged to try it: those who do try it rarely return to the package-by-layer style.)

The hirondelle.web4j.config package is special, and is reserved by WEB4J for the exclusive use of the application programmer. See BuildImpl in the WEB4J javadoc for more information.

The RECAPTCHA mechanism requires each deployment to acquire an account with, along with a public key and a private key. Those keys are used in:

If you don't make those settings, then the application will not operate.

Version History

Version Number Convention

The first three parts of the version number of this application is synchronized with the version number of the corresponding web4j.jar version number with which it was built. - published October 19, 2013

Updated the version of web4j.jar. This is the first version to use JDK 1.6. - published October 5, 2013

Updated the version of web4j.jar. - published June 9, 2012

Updated the version of web4j.jar. - published September 24, 2011

Updated the version of web4j.jar, which had a simple bug fix. - published September 17, 2011

Updated the version of web4j.jar. Two config items that force creation of threads have been removed from web.xml: The displayMessages.tag has been altered, to simply remove session-scope messages after they have been displayed. - published July 9, 2011

The only change is to web4j.jar, which had a bug-fix release. - published May 15, 2011

The only change is to web4j.jar, which had a bug-fix release. - published March 1, 2011

Includes an implemention for the new LoginTasks interface. The old Servlet Filter, which used to react to user login, has been removed.

New settings in web.xml, for the improved implementation of EmailerImpl. - published January 29, 2011

Bug fix release, for correcting errors related to encoding. - published April 17, 2010

Use of String has been replaced with Id or SafeText where possible.

Tags related to translation have been removed from JSPs. This app is in a single language, with no translation. - published January 30, 2010

One bug fix:

As well, this version uses the new DateTime building block class. - published September 7, 2009

This is the first version. It was built with web4j version 4.3.0.


Copyright Hirondelle Systems - Generated 2013Oct19.12.27