Visual Age 3.5x uses a JRE within the IBM distribution. for IBM's
appletviewer, the java.policy is at:
        c:\Program Files\IBM\Visual Age for Java\ide\program\lib\security.

when you run the applet from a browser, you will need to put the java.policy
into the security directory for the
JRE for the applet.  this will only work if you are using the java plug-in.
both IE & Netscape (not 6 though, but
nothing seems to work with 6) are still at 1.1.

when you open your browser are using 127.0.0.1:8080 as the host?  so VA's
test web server is running?

-steve

> -----Original Message-----
> From: Vacca Davide [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 24, 2001 6:51 AM
> To: [EMAIL PROTECTED]
> 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.
*****************************************************************
DISCLAIMER:   The information contained in this e-mail may be confidential
and is intended solely for the use of the named addressee.  Access, copying
or re-use of the e-mail or any information contained therein by any other
person is not authorized.  If you are not the intended recipient please
notify us immediately by returning the e-mail to the originator.

___________________________________________________________________________
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