Background:
My development of the Education Center servlet was a "layered" effort: beginning with the installation and and configuration of my own public accesible web server, configuring the Tomcat web application server for the necessary servlet environment, and finally the coding and testing of the web application itself. As a JDBC (Java database application), the result was the development of a 3-tier application: the web client interface, the MySQL database itself, and finally the servlet containing the SQL code to to manipulate the database tables and present the desired results to the user. Even though it is conceptually a 3-tier web application, physically the SQL database and the servlet environment reside on the same machine (for the sake of simplicity and the monetary and time costs of having to setup of yet another unix machine).
I also used a few 3rd-party software tools to setup and manage the web server and the web application. Near the lowest level, I used iTools Administration Server 7.3 runs on my unix (Macintosh OS X) environment to manipulate the MySQL, Tomcat, PHPMyAdmin, and general network environment. For the creation of the MySQL database tables, I used PHPMagic 1.1 and the Eduation Center script that is available for download here: http://www.websitedatabases.com/samples.html.
I then manually populated my tables with sample data that would later be manipulated by the servlet. My database table structure and data can be viewed and directly manipulated at this location on my webserver: http://www.intrepid.ws/education_center/index.html.
WebMacro was another tool (an open source java library), the allowed seperation of the servlet presentation side from the servlet logic. This is essentially the same idea as creating JSP (Java Server Pages) to work together with servlet code files: html (presentation code) and servlet logic code can be developed more independently of each other. This is another example of the MVC (model view controller) ideal of software development. More details, a tutorial, and downloadable examples of WebMacro can be accessed at their main website: http://www.webmacro.org.
Using the Java IDE, Simplicity Enterprise, I was able to quickly test the MySQL database driver along with various SQL expressions that I considered. This graphical software environment enabled me connect to a remote or local database, view its tables, and create SQL statements, and immediately see the results without having to take the more laborious route of having to recompile, redeploy, and run my servlet just to test each particular SQL statement.
The final coding and testing of the Education Center servlet involved slightly changing the original database structure and SQL statements to get my desired results. Additionally, I created, deployed, and tested the WAR (Web application ARchive) file that contained all compiled code, dependencies, (and source code). This is accessible for download here (using a right click): EducationServlet.war. The advantage of using a WAR file is that the application can be easily transferred to another equivalent Tomcat webserver without having to move each individual file that enables the servlet to their appropriate location. The Tomcat admin tool interface allows easy deployment of a valid WAR file that contains an entire web application.
In order to allow access to www.intrepid.ws/EducationCenter/EducationCenter.html instead of the typical Tomcat port 8080 (e.g. www.intrepid.ws:8080/EducationCenter/EducationCenter.html), I configured the mod_jk Tomcat connector. This redirects servlet requests to the Apache server (hence no need to specify port 8080, and no need to port forward 8080 on my router).
Object Model:
Besides the database diagram and structure defined in the above link, the servlet class and other parts with which it collaborates is depicted simply here: EducationCenterOM.
Instructions:
At the application's runnable link, enter a number between 1 and 25. Each of these integers represent the "Social Security numbers" of the few handful of imaginary of students with dummy data already entered (At least 25 at the time of this writing). The submit button executes a query drawn from various tables and displays the student name, id (or SSN), past class enrollment, and grades for each student number entered. The servlet's behavior can be further appreciated by adding (or changing) student info in the database tables at the link http://www.intrepid.ws/education_center/index.html, and then rerunning the servlet to display the new results. Be careful to examine the tables and existing data to ensure that any new entries you make are consistent and valid representions of a given student!
More to do:
Probably the most important addition to the Education Center servlet would be the ability to update the MySQL tables (add students, courses, etc.). This could become as complex as one desires such as requiring passwords to allow different users different capabilities. Students could only view certain results, instructors could update tables, and an administrator could have all capabilities. Cookies could be used to store this information for each user. Also, more security could be added using an SSL certificate. This would require configuring my Apache and DNS to run an ip-based virtual host.