Due date: November 19, 1999 (Thursday)
(1) Repeat question (1) of Homework #8 using Cold Fusion. This time, the Excel worksheet can be accessed using the DSN f99hw8. Mr. Kanchana Weerasinghe, my research assistant, who has designed and implemented the solution, will post some useful hints in the message board (thanks to him!)
Note that there is a slight change in the contents of the excel file ('Homework #1' becomes 'Homework_1'). An image of the file follows.
(2) Write a Java servlet program, f99jsq1.java that takes an user input on certain support area and lists the information on the support area. The program should use a text file with one record per line. Here is an example of the data file.
f99jsq1d1.txt
MID199,Shuttle,Enhanced Valve A,C
MID200,Shuttle,Enhanced Valve B,C
MID201,Shuttle,Enhanced Valve C,C
MID203,Shuttle,Enhanced Valve D,C
MID204,Shuttle,Enhanced Valve E,C
MID205,Shuttle,Enhanced Valve F,C
MID206,Shuttle,Enhanced Valve G,C
MID207,Shuttle,Enhanced Valve H,C
MID208,Shuttle,Enhanced Valve I,C
MID209,Shuttle,Enhanced Valve J,C
MID210,Shuttle,Enhanced Valve K,C
LatVal1,Shuttle,Latitude Monitor 1,B
LatVal2,Shuttle,Latitude Monitor 2,B
LatVal3,Shuttle,Latitude Monitor 3,B
LatVal4,Shuttle,Latitude Monitor 4,B
LatVal5,Shuttle,Latitude Monitor 5,B
LatVal6,Shuttle,Latitude Monitor 6,B
LatVal7,Shuttle,Latitude Monitor 7,B
LatVal20,Space Station,Latitude Monitor S1,B
LatVal21,Space Station,Latitude Monitor S2,B
LatVal22,Space Station,Latitude Monitor S3,B
LatVal23,Space Station,Latitude Monitor S4,B
LatVal24,Space Station,Latitude Monitor S5,B
LatVal25,Space Station,Latitude Monitor S6,B
LatVal26,Space Station,Latitude Monitor S7,B
LGP10,Shuttle,LGP Gauge #1,A
LGP20,Space Station,LGP Gauge #21,A
LGP30,Space Station,LGP Gauge #22,A
KKI2,Space Station,KKI Unit #2,B
KKI3,Hubble,KKI Unit #3,B
KKI4,Hubble,KKI Unit #4,A
LMI700,Hubble,LMI Synchronizer #1,B
LMI750,Hubble,LMI Synchronizer #2,B
LMI780,Hubble,LMI Synchronizer #3,B
The field of each record is separated by a comma. The fields are sensor symbol, support area, description and class code respectively.
A shtml file using the text file is shown below:
f99jsq1.shtml
<html>
<body bgcolor=#ccccff>
<servlet code=csci4230fl99.f99demo1.examples.hw.f99jsq1>
<param name=filename value=f99jsq1d1.txt>
</servlet>
</body>
</html>
Note the parameter for specifying the input data file name, which should be stored in the same directory of f99jsq1.shtml.
An url specifying the support area is
http://lattes.uhcl.edu:8080/.../shtml/f99jsq1.shtml?area=Shuttle
The output should be:
If an unknown area is given, for example,
http://lattes.uhcl.edu:8080/.../shtml/f99jsq1.shtml?area=garbage
the output should be:
Your java servlet should be written to accept different data file. For example, for
f99jsq1d2.txt
MID199,Shuttle,Enhanced Valve A,C
MID200,Shuttle,Enhanced Valve B,C
MID207,Shuttle,Enhanced Valve H,C
MID208,Shuttle,Enhanced Valve I,C
MID209,Shuttle,Enhanced Valve J,C
MID210,Shuttle,Enhanced Valve K,C
LatVal1,Shuttle,Latitude Monitor 1,B
LatVal2,Shuttle,Latitude Monitor 2,B
LatVal3,Shuttle,Latitude Monitor 3,B
LatVal4,Shuttle,Latitude Monitor 4,B
LatVal5,Shuttle,Latitude Monitor 5,B
LatVal21,Space Station,Latitude Monitor S2,B
LatVal22,Space Station,Latitude Monitor S3,B
LatVal23,Space Station,Latitude Monitor S4,B
LatVal24,Space Station,Latitude Monitor S5,B
LatVal25,Space Station,Latitude Monitor S6,B
LatVal26,Space Station,Latitude Monitor S7,B
LGP10,Shuttle,LGP Gauge #1,A
LGP20,Space Station,LGP Gauge #21,A
LGP30,Space Station,LGP Gauge #22,A
KKI2,Space Station,KKI Unit #2,B
KKI3,Hubble,KKI Unit #3,B
KKI4,Hubble,KKI Unit #4,A
LMI700,Hubble,LMI Synchronizer #1,B
LMI750,Hubble,LMI Synchronizer #2,B
LMI780,Hubble,LMI Synchronizer #3,B
XPG61,Hubble,XMP Synchronizer #1,A
XPG62,Shuttle,XMP Synchronizer #1,A
XPG63,Space Shuttle,XMP Synchronizer #1,A
The shtml file using the text file is shown below:
f99jsq2.shtml
<html>
<body bgcolor=#ccccff>
<servlet code=csci4230fl99.f99demo1.examples.hw.f99jsq1>
<param name=filename value=f99jsq1d2.txt>
</servlet>
</body>
</html>
For the url
http://lattes.uhcl.edu:8080/.../shtml/f99jsq2.shtml?area=Shuttle
the output should be:
Your program should generate HTML code as close to above as possible.