![]() |
![]() |
Here are the steps you need to take.
xerces.jar
from /u/dgerman/public
.
$TOMCAT_HOME/lib/
directory.
CLASSPATH
environment variable.
This has to be done in yoursetenv CLASSPATH $TOMCAT_HOME/lib/xerces.jar:$CLASSPATH
~/.cshrc
file. Here's how my CLASSPATH variable looks like now:
burrowww.cs.indiana.edu% echo $CLASSPATH /u/dgerman/apache/jakarta-tomcat-3.2.3/lib/xerces.jar:.:/u/dgerman/apache/jakarta-tomcat-3.2.3/lib/servlet.jar burrowww.cs.indiana.edu%
This has to be done in yoursetenv startTomcat $TOMCAT_HOME/bin/startup.sh setenv stopTomcat $TOMCAT_HOME/bin/shutdown.sh
~/.cshrc
file.
Now you can use $stopTomcat
and $startTomcat
from the command line.
(Do it when you recompile and have to reload a servlet.)
/u/username/foobar
for your FooBar Bookstore Co. filesystem.
/u/username/foobar/data
for the FooBar 'database'.
interface.html
into your apache_1.3.20/htdocs
.
addBook.pl
into your apache_1.3.20/cgi-bin/foobar
folder.
/u/username/foobar/data/dataFile.txt
gets created.
catalog.pl
into your apache_1.3.20/cgi-bin/foobar
folder. Here's the code, that I forgot to post yesterday.
#!/usr/bin/perl use CGI; $query = new CGI; print $query->header, $query->start_html, "This is the Foobar Library Catalog. <p> "; open (AB, "/u/dgerman/foobar/data/dataFile.txt"); @x = <AB>; close(AB); %library = (); foreach $line (@x) { @line = split(/:/, $line); $isbn = $line[4]; $title = $line[0]; $author = $line[1]; $subject = $line[2]; $publisher = $line[3]; $isbn = $line[4]; $price = $line[5]; $numPages = $line[6]; $description = $line[7]; print qq{ <hr> <dl> <dt>Title</dt> <dd> $title<p></dd> <dt>Author</dt> <dd> $author<p></dd> <dt>Subject</dt> <dd> $subject<p></dd> <dt>Publisher</dt> <dd> $publisher<p></dd> <dt>ISBN</dt> <dd> $isbn<p></dd> <dt>Price</dt> <dd> $price<p></dd> <dt>Number of Pages</dt> <dd> $numPages<p></dd> <dt>Description</dt> <dd> $description <p></dd> </dl> }; } print "<hr> This is the catalog, thank you. ", $query->end_html;
DOMreport.pl
to the cgi-bin/foobar
folder.
If you do want to practice I suggest you run FirstParser
and
then IndentingParser
on the customer.xml
file. Change
it, update it, see what the programs report. Look into the programs as well. Use
the documentation posted here
and here as well.
Ten.java
in $myServlets
.
IndentingParser.java
in $myServlets
.
http://burrowww.cs.indiana.edu:32xxx/examples/servlet/Ten
and
view source.
A348/A548