Progress
Open Client
Developer’s Guide


Supporting Both Browsers In a Single Applet

The following code works for both Microsoft Internet Explorer and Navigator in a single applet.

NOTE: To test this code, make sure that both security manager classes are in your CLASSPATH.

import com.ms.security.*;
import netscape.security.PrivilegeManager; 
try 
{ 
// Assert Net IO privileges 
     System.out.println("Checking for Internet Explorer Security Manager"); 
      if (Class.forName("com.ms.security.PolicyEngine") != null) 
     PolicyEngine.assertPermission(PermissionID.NETIO); 
} 
catch(ClassNotFoundException e) 
{ 
       System.out.println("IE Security Manager not found"); 
} 
try 
{ 
        System.out.println("Checking for Netscape Security Manager"); 
        if (Class.forName("netscape.security.PrivilegeManager") != null) 
        { 
           try 
           { 
                   PrivilegeManager.enablePrivilege("UniversalConnect"); 
           } 
            catch(Exception ex) 
            { 
                   System.out.println("Netscape threw exception: " +
                   ex.toString());  
            } 
       } 
} 
catch(ClassNotFoundException e) 
{ 
        System.out.println("Netscape Security Manager not found"); 
} 


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095