Sun
ONE Active Server Pages Product Home Page Developer Site Version
 

ContentsPreviousNextIndex



Registering a Java Class as a COM Component on Linux and UNIX


The chregclass tool included with Sun ONE ASP enables you to register a Java class as a COM component on Linux and UNIX. You register a Java class by using the chregclass tool to create a registry entry that maps a given ProgID to the Java class. The chregclass tool is similar to the javareg tool provided for the Microsoft JVM.

Note icon Note To register a Java class to use with Sun ONE ASP, the .class file must exist in a directory that is listed in the Java CLASSPATH environment variable.
   Any class registered by using chregclass must have a public default constructor to instantiate the class. This applies to all chregclass calls.

To register a Java class as a COM component

  1. Log in as root and change directories to the Sun ONE ASP installation directory.

  2. Stop the ASP Server, as described in Stopping and Restarting the ASP Server (Admin Console).

  3. Map the ProgID to the Java class by running the following command:

  4. chregclass [-f] [ProgID] [JAVA_CLASS]

    where [ProgID] is the Prog ID you want to map and [JAVA_CLASS] is the name of the Java class you want to register. [JAVA_CLASS] should not include the .class extension. If it does, the mapping will not work.

  5. Restart the ASP Server, as described in Stopping and Restarting the ASP Server (Admin Console).

For example, to register the Table class in the Database package on the CLASSPATH, use the following command:

chregclass Db.Table Database/Table 

After running this command, you can then construct a Table object in a script as follows:

Set table = Server.CreateObject("Db.Table")


ContentsPreviousNextIndex