Instantiating the component

JSP targets If you are not using the jspobject105.jar object model, you instantiate a Web DataWindow component in the following manner:

<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="org.omg.CORBA.ORB" %>
<%@ page import="org.omg.CosNaming.NamingContext" %>
<%@ page import=          "org.omg.CosNaming.NamingContextHelper" %>
<%@ page import="org.omg.CosNaming.NameComponent" %><%@ page import="DataWindow.*" %>

String dwGenerator = "DataWindow/HTMLGenerator105";
HTMLGenerator105 dwGen = null;

java.util.Properties props =new java.util.Properties();
props.put("org.omg.CORBA.ORBClass",
   "com.sybase.CORBA.ORB");
props.put("com.sybase.CORBA.NameServiceURL",    "iiop://testmachine:9000");
ORB orb = ORB.init((String[])null, props);
try {
	  NamingContext cntx = NamingContextHelper.narrow       (orb.resolve_initial_references("NameService"));
     	NameComponent[] name = {new        NameComponent(dwGenerator,"")};
     	SessionManager.Factory factory =        SessionManager.FactoryHelper.narrow
         (cntx.resolve(name));
	  dwGen =         HTMLGenerator105Helper.narrow(factory.create
          ("jagadmin",""));
} catch(org.omg.CORBA.ORBPackage.InvalidName ie) {
		out.print("Error: " + ie.getMessage()); 
} catch (org.omg.CosNaming.NamingContextPackage.NotFound ne) {
		out.print("Error: " + ne.getMessage()); 
} catch 
(org.omg.CosNaming.NamingContextPackage.CannotProceed     ce) {
		out.print("Error: " + ce.getMessage()); 
} catch 
(org.omg.CosNaming.NamingContextPackage.InvalidName     ie1) {
		out.print("Error: " + ie1.getMessage()); }

ASP targets You can access the registered COM component using its Program ID. For example, if you use the generic component:

	dwGen = Server.CreateObject(
		"PowerBuilder.HTMLDataWindow")