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