Hints for Project Part 2:

There are many ways to design good web interface programs. Feel free to skip these hints if you want to make your own design. These hints are provided only as additional help for those who need them, but you are under no obligation to follow them.

Hints on general design:

In this part of the project, you will have multiple operations with different SQL commands. You can probably do so by writing one servlet per operation, and designing web forms to call the appropriate servlet for each operation. However, it is easier (and more expandable) to write only one servlet to take care of all operations. The servlet should expect a parameter operationID that dictates which operation to carry out. For example,

OperationID

operation

1

display table Actors

2

display table Actors with Year>n

3

insert one tuple into table Actors

Your servlet will read the parameter operationID and decide which functions to call, and what other parameters to read (if any).

The parameter operationID can be conveniently passed from a web form to the servlet through the use of "hidden" input:
<INPUT TYPE="hidden" NAME="operationID" VALUE="1">

In addition, you might want to set up a "main menu" page with links to web pages that handle different operations. This can be done with HTML and no programming.

Hints on link-based browsing:

Note that your servlet can be called directly through a URL in the following way:
http://landfair.seas.ucla.edu:32730/servlet/myServlet?param1=value1&param2=value2&param3=value3
where myServlet is the name of your servlet, and the string after the question mark contains parameters passed to the servlet just like in a "GET" method. So you can implement link-based browsing by generating result pages containing hyperlinks of the above format, with appropriate parameters that instruct your servlet to execute the right query.