Maxime Poulin wrote:
>
> Well, here is a reply to my own message :
>
> I made some more tests and I found out that if either of the 2 values
> passed to the Hashtable when instantiated (start size and growth factor) is 0,
> then I get the exception I mentionned. However, if both digits > 0, then
> everything works perfectly... There is surely something I do not get here... I
> mean, these 2 digits are just there to indicate the starting size of the table
> and the rate at which that table will grow... this should not affect the way
> the thing is sent through the wire !!!
Although you do seem to have a problem with how you use Hashtable, that is not
what is causing the exception you list. Yes, if you ever use 0 as the second
parameter you will have a problem.
The second parameter in the Hashtable constructor is called the load factor. The
phrase you use, "growth factor" implies something different to me, and perhaps
indicates that you might be confusing the Hashtable with a Vector. Go read the
API document: http://java.sun.com/products/jdk/1.2/docs/api/index.html
If you write
hTable = new Hashtable(1,0);
you will get an exception when you run your servlet because 0 is an illegal load
factor.
However
hTable = new Hashtable(0,1);
is legal and will work (although it may not be the best way to create a
Hashtable).
Assuming the snippet you listed is accurate, if the servlet code throws an
exception, no output is written to the output stream, which might cause the
applet to show a FileNotFound exception. Try putting a try-catch block in your
servlet so you can see the stack trace. The catch block should also send some
kind of response back to the client. In general, you never want your servlet to
fail to send some kind of response back to the client.
It is also possible that the problem lies elsewhere.
The problem might lie here:
URL url = new URL(getCodeBase() + "servlet/Servlet1");
String params = "?format=use_socket";
url = new URL(url.toExternalForm() + params);
Which, by the way, could be reduced to a single line of code:
URL url = new URL(getCodeBase() + "servlet/Servlet1?format=use_socket");
This is the line of code that creates the filename that is printed in the
exception message. If you post the complete stack trace from the exception, then
that might provide more information to solve your problem.
K Mukhar
___________________________________________________________________________
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