In this exercise you will create a Web page that retrieves data from a database and delivers it to a user. Communication between your page and the database server will be handled by a helper class called a "Java Bean."
For the purpose of this exercise, you have two personal directories on waycross.cs.uga.edu:
| Directory | Purpose |
|---|---|
| /opt/jakarta-tomcat-4.1.24/webapps/csx37/<your-login-name> | Your JSP files |
| /opt/jakarta-tomcat-4.1.24/webapps/csx37/WEB-INF/classes/<your-login-name> | Your JavaBean class files |
Please do not store Java source code files in these directories, which are publicly viewable. Keep your source files in your home directory (outside your public_html directory). You can use the -d flag on your javac command to write the class files into the class directory shown above.
The easiest way to access these directories is to log in to your account on atlas, then remotely login to waycross:
rlogin waycross.cs.uga.edu
You will use your atlas password on waycross (password authentication is a shared network resource, via a network-enabled database technology called "NIS"). Once logged into waycross, you can change directories to your web directory listed above. Note that this directory is only accessible when you are logged into waycross.
Please use your login name as a package name for your JavaBean files. For example, if your login name is "dogbiscuit," your code would look like:
package dogbiscuit;
import java.sql.*;
...
public class DatabaseBean {
...
It is important to follow this convention so that Tomcat can find your JavaBean class files.
JSP and HTML files placed into your directory are mapped to the URL:
http://waycross.cs.uga.edu:8080/csx37/<your-login-name>/<your-file-name>
Tomcat will automatically compile your JSP files into servlets, so this URL takes some time to resolve the first time after you have modified your JSP file. I strongly recommend testing your business logic from the command line before attempting to run your class as a bean (see the technology demo below). Note that the Tomcat Web server runs on TCP port 8080 instead of the normal port 80. Also, the Web address does not include a tilde character ("~").
The database for this class is located at waycross.cs.uga.edu. All students will have read-only access to the database, using the user name guest and an empty password. More details are provided in the mission statement below.
» Your Mission: (requires Java-enabled browser and speakers for best effect)