Lightweight

Lightweight Java: unzip and run

I have been working with Ruby and .NET mostly for last 1.5 years. I spent last weekend to pick up my Java, it wasn’t hard, worked with Java for about 8 years after all. I re-created the lightweight java framework with latest version of goodies: Spring, Hibernate, Struts, HSQLDB, Jetty.

The zip file is quite big: 12M, that’s because it includes all the libraries: Spring, Hibernate, Struts, HSQLDB, Jetty, ..., etc. The build script (Ant) generates a WAR file, which can be deployed into any J2EE containers with a little vendor-specific configuration. Yes, the build script also generates unit test and code coverage report.

A few notes on testing:
  • Can unit test the view because of using Velocity
  • Unit test Database access layer Hibernate + HSQLDB, very cool! (Thanks Jon Tirsen)
  • A single StrutsTestCase (with Spring aware) for unit testing Struts actions
  • Use JWebUnit for functional testing, will move to rWebUnit

The sample application is a online video store, my pet project. I removed the original web framework WebWork, as it is going to be merged to Struts2 anyway. The application logic is left empty at the moment.

Here is the release notes:
  1. Unzip the lightweight_java*.zip to a folder
  2. Double click the ‘run.bat’ under the folder (Unix/Mac guys, I am sure you know what to do)
  3. Open your browser, enter url: http://localhost:8080/videostore

Download Zip file

Screenshots:
1. Start the server in IDE (Intellij IDEA) < 5 seconds: lightweight_idea

2. Access the home page in a web browser: lightweight_web