Web Applications
Two web applications come with the Fortune Server:
- FortuneServer is the user-friendly GUI front end featured in the Introduction.
- FortuneQuery lets you execute ad hoc SQL statements and was featured in the early section on installing Tomcat.
Because of the Fortune Server's LifecycleListener implementation, multiple instances of both web applications can run simultaneously; and, incidentally, FortuneQuery can connect to databases other than just the fortunes database.
Both applications are implemented as JavaServer Pages (JSPs). For a handy writeup on JSPs see http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev. Both applications share the standard layout for a web application:
Document root | JSP pages. |
/WEB-INF/web.xml | Deployment descriptor. |
/WEB-INF/lib | Any jar files. |
/WEB-INF/classes | Any classes. |
The FortuneServer and FortuneQuery web applications are quite simple and neither has classes or jar files to load.
FortuneServer2 includes a LoadCategories servlet that dynamically fetches the list of categories from the Derby database the first time the webapp is called. See $FORTUNE_HOME/java/ClientApps/FortuneServer2/README for build instructions.