Hi,

First thanks very much for all  friends who reply my last question!  :-)
and according to your directions,  I add "CODEBASE=.." in my html, and put my
applet in ".../j2sdk2.1/webpages". It works.



Now I met another problem :-)
1.
Now I want to use "HTTPTunneling" to send a String to my servlet from my
applet. I wrote the following lines:

...
URL url=null;
URLConnection con=null;
ObjectOutputStream os=null;
ObjectInputStream is=null;

try{
url=new URL("HTTP://xxx.xxx.xxx.xxx:8080/servlet/myservlet);
con=(URLConnection)url.openConnection();
con.setUseCaches(false);
con.setRequestProperty("CONTENT_TYPE", "application/octet-stream");
con.setDoInput(true);
con.setDoOutput(true);
  }catch(Exception e){ System.out.println("in connect, e="+e);  }


    try{
    os=new ObjectOutputStream(con.getOutputStream());
    os.flush ();
    os.writeObject("this is a test string");
    os.flush ();
    os.close (); os=null;
    }catch(Exception e){ System.out.println("in write, e="+e; }

  try{
  is=new ObjectInputStream(con.getInputStream());
  s_tmp=(String)is.readObject();
  is.close(); is=null;
  }catch(Exception e) { System.out.println("in read, e="+e);  }



2. I use jsdk2.1 as my "servlet engine". I copy myservlet.class to
.../jsdk2.1/webpages/WEB-INF/servlets.


3.
a. if I use a "Java application" to test the above lines, it works.
b. If I use Netscape4.7 to run my applet, it works well.
c. But when I use IE5 to run my applet, I got a "Exception":
    in write,  e= java.io.FileNotFoundException :
xxx.xxx.xxx.xxx:8080//servlet/myservlet


So my question is:
1. I noticed that in IE5, my original
"HTTP://xxx/xxx/xxx/xxx:8080/servlet/myservlet" has been chanegd to
"xxx.xxx.xxx.xxx:8080//servlet/myservlet" , so I got a Exception.    "/" has
been changed to "//"   :-)
2. So does IE5 use the "original class java.net.URLConnection " ? because with
both j2SE 1.2.2_05a_PR and Netscape4.7,  it works, so I guess perhaps IE5 use
another java.net.URLConnection.
3. Did anybody meet the same problem? Could anybody tell me How to fix it?


Thanks in advance!




Bo
May 30, 2000

___________________________________________________________________________
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

Reply via email to