Running in Java applets

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: