Library tutorials & articles
Using Components and Objects in ASP
- Introduction
- Advantages
- Using Objects
- Creating COM components
- Using Built-in ASP objects
- Creating objects from a java class
Creating objects from a java class
To use Server.CreateObject to create an instance of a Java class, you must
use the JavaReg program to register the class as a COM component. You can then
use Server.CreateObject method or an HTML <OBJECT>
tag with the PROGID or CLSID. Alternatively, you can use the mechanism provided
by Java monikers to instantiate the Java class directly without using the JavaReg
program. To instantiate a class with monikers, use the VBScript or JScript GetObject
statement and provide the full name of the Java class in the form java:classname.
The following VBScript example creates an instance of the Java Date class.
<%
Dim dtmDate
Set dtmDate = GetObject("java:java.util.Date")
Response.Write "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 monikers, however, you must be using version 2.0, or later, of the Microsoft
virtual machine.
Related articles
Related discussion
-
Read eMails from Outlook express using ASP
by kumaravelu (1 replies)
-
Help to Call ASP function from onclick event in HTML to pass an array
by vka (0 replies)
-
Binary Studio | software development outsourcing Ukraine
by shane124 (4 replies)
-
Variable In Vb.Net
by chia (0 replies)
-
ideas in building a captive portal
by sjranjan (2 replies)
Related podcasts
-
Scott Guthrie
Scott catches up with Scott Guthrie in an interview covering Ajax, Asp 2.0, extender controls, CSS adapters and more.
If you want to try using components, start using those allready installed on your server. Use this script to check your IIS for installed components:
http://www.bier-voting.de/objcheck/
This thread is for discussions of Using Components and Objects in ASP.