[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] JAVA applet net problemer



Carsten Fjelkstrup wrote:

Nu er det godt nok noget tid siden jeg har kodet Applets, men det kunne se ud som om din Applet ikke får lov til at komme ud af "sandkassen"...

Har du signeret Appleten så brugeren bliver promptet for om han vil køre den og dermed tillade at den går uden for "sandkassen"?

Venlig hilsen

Carsten Fjelkstrup
http://carzzzer.dk



Jeg bruger ikke signed applets, men det burde heller ikke være nødvendigt. Jeg har følgende fra http://java.sun.com/sfaq/#socket:
<citat>


Applets are not allowed to open network connections to any computer, except for the host that provided the .class files. This is either the host where the html page came from, or the host specified in the |codebase| parameter in the |applet| tag, with |codebase| taking precendence.

For example, if you try to do this from an applet that did not originate from the machine foo.com, it will fail with a security exception:

	Socket s = new Socket("foo.com", 25, true);

</citat>

...og jeg har følgende i min kode:
   public void connect(int port) {
       String host = getCodeBase().getHost();
       try {
           client.connect(host, port);
         .....

..så der burde ikke være problemer.
Men jeg har så fundet ud af at min applet virker i Internet Explorer, men ikke i Mozilla. I Mozilla må appletten til gengæld gerne forbinde tilbage til serveren, som hostede siden. Er der fejl i Mozilla ?


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2006-05-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *