have on thedownload site is 4.0. This version which I have used for six months has neverfailed me. It installs and sets up everything for you. It even tells you it found thej2 SDK for you.

Also it allows one to test Java Servlets easily on your ownmachine.

The one problem is that Tomcat must be restarted each time a new Servlet isadded. HTML pages with jars do not need it restarted.

3.

Servlet Jar

If you were to load a Servlet in Eclipse, it will have compile errors as the standardof the j2 SDK does not support Servlets. However, Tomcat includes a Servlet Jarwhich I also have on my web page. By adding this external jar to the Projectproperties, the problem goes away.

A screen shot of the Project properties is shown below. Notice the external jarcalled servlet.jar inC\:eclipse

folder. To add, just click onAdd External JARs.

California State Polytechnic University, Pomona

Computer Information Systems Department

Spring 2003 CIS 424-

Advanced Java Programming Dr. Stumpf

fortunabrontide_c291402f-158d-45f6-96a5-92514b824f94.doc

version 1.011/13/13

page2

of5

This will only enable compilation of a Servlet.. Eclipse at present does notsupport debugging with Tomcat. It however runs great with Tomcat.

4.

Exporting Servlets to Tomcat.

Go to the Eclipse workspace and copying the package folder and place it in theTomcat classes folder under examples.

A sample of such a folder in Tomcat is shown below. The example shows afolder nameduser042. You will use the folder

calledexamples

which is alreadypresent.

California State Polytechnic University, Pomona

Computer Information Systems Department

Spring 2003 CIS 424-

Advanced Java Programming Dr. Stumpf

fortunabrontide_c291402f-158d-45f6-96a5-92514b824f94.doc

version 1.011/13/13

page3

of5

Note I have a folder called user042. It has four packages in it. The eesprogram4example is from my fall quarter 2003 CIS 424 class. The Java Bean supports aJSP page that shows the database so the students can tell if they corrected wrote tothe database.

5.

Use of MS Access for a database.

You must have MS Access installed. Download the database from yourinstructor’s web site. You must then make an ODBC connection to this databasesuing the ODBC Data

Sources in the control panel.

California State Polytechnic University, Pomona

Computer Information Systems Department

Spring 2003 CIS 424-

Advanced Java Programming Dr. Stumpf

fortunabrontide_c291402f-158d-45f6-96a5-92514b824f94.doc

version 1.011/13/13

page4

of5

Then you must open the data source and click add.

The n you must fill in the data souce name.

California State Polytechnic University, Pomona

Computer Information Systems Department

Spring 2003 CIS 424-

Advanced Java Programming Dr. Stumpf

fortunabrontide_c291402f-158d-45f6-96a5-92514b824f94.doc

version 1.011/13/13

page5

of5

Use the name payroll. The example uses paycheck. This completes theassignment of a DSN (Data Source Name).

6.

Oncethe Servlet is moved to the Tomcat directory and the data source name isspecified, one may then test the Servlet. First Open Tomcat. Second be sure thehost address is:

Servlet you are using. The Servlet is obtained from theinstructor’s web site. Third after it is running, run the program in Eclipse.

7.

A word about debugging. It is wise to in break points in the create method andfollow it closely each step. Alsolook at the Tomcat console window. Errors suchas security mean the policy file is not correct. Errors such as EOF (End Of File)mean the number of elements writing and reads do not agree. A lot ofinformation is available in the Tomcat console.