EJB clients that run as applets can set the APPLET parameter for the javax.naming.InitialContext instance used to connect to EAServer. For example:
java.util.Hashtable p = new java.util.Hashtable(); p.put(Context.APPLET, this); // Sybase implementation of InitialContextFactory p.put(Context.INITIAL_CONTEXT_FACTORY, "com.sybase.ejb.InitialContextFactory"); // URL for the Server's IIOP port. Host defaults to // the applet download host. p.put(Context.PROVIDER_URL, "iiop://:2000"); // Username "Guest", password is "GuestPassword" p.put(Context.SECURITY_PRINCIPAL, "Guest"); p.put(Context.SECURITY_CREDENTIALS, "GuestPassword"); // Now create an InitialContext that uses the // properties. InitialContext ic = new InitialContext(p);
Setting the APPLET parameter activates the following convenient features:
The host name can be omitted in the initial context URL that is specified as the PROVIDER_URL context parameter. The default host is the applet download host.
You can set the com.sybase.ejb.autoProxy property and it will work as documented in Chapter 9, “Deploying Applications Around Proxies and Firewalls,” in the EAServer Security Administration and Programming Guide.