Hi,
 I wrote a program to call servlet from my applet.
applet snippet looks,
-------
   String urlStr = "http://x.x.x.x/servlet/MyServlet"; // x.x.x.x - ip addrs
        URL servletURL = new URL(urlStr);
        URLConnection servletConn = u.openConnection();
        servletConn.setDoOutput(true);
        servletConn.setDoInput(true);
        servletConn.setUseCaches(false);
        servletConn.setDefaultUseCaches(false);
        servletConn.setRequestProperty("Content-Type", "application/octet-stream");
        ObjectOutputStream out = new ObjectOutputStream(servletConn.getOutputStream());
        out.writeObject("Hai from applet to servlet");
        out.flush();
        out.close();
------------
and servlet code looks,
--------
  public void doPost(HttpServletRequest request, HttpServletResponse response) throws 
ServletException, IOException {
    response.setContentType("text/html");
    PrintWriter out = new PrintWriter (response.getOutputStream());
    System.out.println("doPost");
    try {
      ObjectInputStream in = new ObjectInputStream(request.getInputStream());
      String str = (String)in.readObject();
      System.out.println("doPost: response from applet="+str);
      in.close();
    } catch(Exception e) { System.out.println("Exception ="+e); }
    out.close();
  } // doPost()
---------
when I execute this applet in Netscape, it's working fine.
If I execute in IE, I getting foll. exception
java.io.FileNotFoundException: mymachine:80//x.x.x.x/servlet/MyServlet
Even if I gave the correct URL, in exception it translating as diferent.
Why ?
Thanx in advance.

___________________________________________________________________________
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