: >PolicyEngine.assertPermission(PermissionID.NETIO);
:
[quoted text clipped - 10 lines]
: Coaching, problem solving, economical contract programming.
: See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Yes, that's what I have...
I found out what is not working...
This applet is multi-threaded and several threads are running and connecting
to different servers... everything works fine...
The problem happens (only on Sun's VM) when a method, called from the web
page, must connect to a server and return some data...
this is the method structure...
public String method(int data)
{
BufferedReader in;
URLConnection c;
String line, aswer;
URL u;
try
{
line = "http://www.domain.com/page.asp?data=" + i;
u = new URL(line);
try
{
c = u.openConnection();
try
{
in = new BufferedReader(new InputStreamReader(c.getInputStream()));
answer = in.readLine();
in.close();
}
catch(IOException ioe)
{
return "error";
}
}
catch(IOException ioe)
{
return "error";
}
}
catch(MalformedURLException e)
{
return "error";
}
return answer;
}
again, works fine under MS VM (with the required permissions)...
Seems that Sun's VM doesn't allow a javascript code to call a method that
connects to another server...
Is there a way to avoid this?
Thanks for any help...
FB
Roedy Green - 30 Mar 2004 22:33 GMT
>Seems that Sun's VM doesn't allow a javascript code to call a method that
>connects to another server...
I wish the Javascript people had used a different name. Half the time
when people say JavaScript they mean Java.
All I can tell you is that ordinary Java Applets can only talk to the
server from which they were loaded unless they are signed and have
permission to talk to "strangers".
If you screwed up your signing, you would never notice till you
started trying to talk to multiple servers.
Interaction between JavaScript and Java is a dark art, a forbidden
subject akin to interspecies sex.
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.