Creating a Java Object in ASP
Written by Eric Smith, Northstar Computer Systems LLC
ASP is one of those languages that plays well with others. If you’ve got a Java class that you want to use in ASP, you have two options, based on what you want to do with the class. You can use Server.CreateObject to create the instance; however, the class must be registered as a COM component on the server. This can be done using the JavaReg program. The second option is to use the GetObject statement, in which you specify the full name of the Java class, in the form java:classname. Here’s an example of this:
<%
Dim dtmDate
Set dtmDate = GetObject("java:java.util.Date")
%>
The date is <%= dtmDate.toString() %>
Objects created by calling GetObject instead of Server.CreateObject can also access the ASP built-in objects and participate in a transaction. To use Java class names (also known as monikers), you must be using version 2.0, or later, of the Microsoft virtual machine.
Keywords: [
Uncategorized ASP Tips
]
Publication Date: 6/1/2000
|