Dont remember exactly as to how I solved this problem but I believe I
removed either the
con.doInput(true);
or
con.doOutput(true);
statement and it worked fine for me.

Hope this helps.

Regards
Rohit Parik
Netweb Software, India
Ph:   +91-265-301424
        +91-265-314729
Fax: +91-265-314756
email : [EMAIL PROTECTED]


----- Original Message -----
From: Vacca Davide
To: [EMAIL PROTECTED]
Sent: Tuesday, April 24, 2001 4:21 PM
Subject: Applet servlet communication in an HTML browser


Hello to everybody,

   I've written an Applet servlet communication application (the Applet cals
the servlet) in Visual Age for Java environment. I've modified the file
"java.policy" putting the following line:
permission java.net.SocketPermission "localhost:8080-",
"listen,connect,accept";
and everythin work fine when I run the application in the Appletviewer.
But when I try to run the Applet in an HTML browser, I get the following
exception when I try to make the connection with the servlet:

com.ms.security.SecurityException(myPackage/myApplet:cannot acces
"localhost":8080

here's the Applet code (in the init method):

URL url =
new URL(this.getCodeBase(),
"http://localhost:8080/servlet/myPackage.myServlet";);
  URLConnection conn = url.openConnection();
  conn.setDoInput(true);
  conn.setDoOutput(true);
  conn.setUseCaches(false);
  conn.setRequestProperty("Content-Type", "pippo");
  InputStream in = conn.getInputStream();

Obviously the Websphere Testing Environment (WTE) is always up, in both
cases.
Is someone able to help me ?
Many thanks in advance for any help or suggestion.

Vacca Davide
Methosystem S.r.L.
Via VIII Marzo
Collecchio (PR)
- Italy -
[EMAIL PROTECTED]

___________________________________________________________________________
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