This probably is a BUG with tomcat. It should not return 404, coz' the
servlet is there.
You will get the same message even if u call the servlet from normal java
code and not applet.
URL url = new URL("http://whatever.com/servlet/SomeServlet")
URLConnection huc = url.openConnection();
huc.setUseCaches(false);
huc.setDoInput(true);
// huc.setDoOutput(true);
// OutputStream os = huc.getOutputStream();
InputStream is = huc.getInputStream();
This will work but if u uncomment the 2 lines above , it returns 404 Error.
Perhaps it has something to do with the post method in the servlet, do u
have a doPost method in the servlet ?
Shuklix
-----Original Message-----
From: Deniz Demir [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 11, 2001 2:26 PM
To: [EMAIL PROTECTED]
Subject: URL socket connection to servlet
Hi,
I have replaced my apache-jserv server with apache-tomcat. In this case my
applet cannot open URL socket connection to my servlet that loads the
applet.
The code in the applet is as follows:
// Get the server URL
String urlString = "http://" + getDocumentBase().getHost() +
"/servlet/LoginServlet";
java.net.URL url = new java.net.URL(urlString);
System.out.println("- url: " + url.toString());
// Attempt to connect to the host
java.net.URLConnection con = url.openConnection();
System.out.println("connection opened...");
And the error message from Java Console of Internet Explorer is as follows:
( www.yfas.com.tr:80//servlet/LoginServlet this address is shown in
netscape as it is in the address bar, that is:
www.yfas.com.tr/servlet/LoginServlet )
- url: http://www.yfas.com.tr/servlet/LoginServlet
connection opened...
java.io.FileNotFoundException: www.yfas.com.tr:80//servlet/LoginServlet
at com/ms/net/wininet/http/HttpInputStream.connect
at com/ms/net/wininet/http/HttpInputStream.<init>
at com/ms/net/wininet/http/HttpURLConnection.createInputStream
at com/ms/net/wininet/WininetURLConnection.getInputStream
at com/ms/net/wininet/http/HttpPostBufferStream.close
at java/io/FilterOutputStream.close
at LoginApplet.validateUser
at LoginApplet.handleEvent
at java/awt/Component.postEvent
at java/awt/Component.postEvent
at java/awt/Component.dispatchEventImpl
at java/awt/Component.dispatchEvent
at java/awt/EventDispatchThread.run
is there any solution for this problem?
Deniz...