Aaron Sani wrote:
>
> Hi. New to Servlets....
>
> I have written a simple java CGI that sorts about 260 rows of a table as read in
> from a tab-delimited text file generated by Excel.
> The CGI works fine. I have since then attempted to convert it into a Servlet
> but with little luck. My servlet references classes created for my CGI that
> reads from the text file and creates an HTMLTable object from the
> HTMLTable("filename") constructor I created. The printHTML() method then
> returns a string containing the necessary code for the proper browser display.
> Again, everything works fine in the CGI implementation. But when I create my
> Servlet and test it using the servletrunner utility, all I get is blank output
> in my browser window! My servlet also reads from another file to collect a
> header and footer for the page i wish to display. Then once it reads the <TABLE
> border> tag in the file, it replaces the table with the servlet generated sorted
> table.
>
> I realize that a JDBC- Servlet-SSI solution may be better but I do not have an
> RDBMS at my disposal and am presently familiarizing myself with SSI's. I will
> be moving to in the near future however to DB2. So once I learn the JDBC API
> and SSI's, I will also need to read from the DB2 table and sort the results.
> Here is a sample of my (very simplistic) source code...
Try using absolute paths instead; the file paths you use now are relative
to the servlet engine's current directory, which can be anywhere depending
on the type of servlet engine. You should also check the engine's log file
for exception stack traces. I'm pretty sure you'll find a FileNotFoundException
or two ;-)
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html