CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 1999
    Location
    Leiden, the Netherlands
    Posts
    116

    Security exception


    Hi,
    I am just new in the world of Java programming and I have the following problem.
    I programmed an application that performs network IO using sockets. This works fine in a console,
    but if I use this network class in an applet, it won't run.
    The browser gives a message about network security exceptions.
    How can I get access to the network out of an applet?

    Thanx in advance,
    Arthur


  2. #2
    Guest

    Re: Security exception

    Java applets have security restrictions and u have encountered a security restriction from the JVM . Applets cannot open network connecions to other machines and can ONLY connect to the machine from where it has been downloaded.So internally the JVM checks if such a connection is legal by invoking some methods of security manager( i dont want go to the details) and it throws the exception. If u still want to override the security restrictions - use signed applets(more info visit java.sun.com/security) OR
    in case ur using netscape use netscape capabilities api(developers.netscape.com)


  3. #3
    Guest

    Re: Security exception

    An applet can make socket connections
    ONLY
    to the machine from which the html was downloaded from.
    Your browser has a security manager which will restrict the applet from making socket connections to host other than the one from which it originated.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured