NCS Logo - Click for home page Northstar Developer Center
Platforms
All Platforms
.NET Framework (1.x - 4.x)
Active Server Pages
ASP.NET
C#
SQL Server
VB.NET
Visual Basic

Keywords
.NET Data Types
.NET E-mail
.NET Events
.NET Functions
.NET Object Programming
.NET System.Configuration
.NET System.Diagnostics
.NET System.IO
.NET System.Net
.NET System.Net.Sockets
Active Data Objects
ASP Architecture
ASP Black Belt
ASP Built-in Functions
ASP Built-in Objects
ASP Debugging
ASP Performance
ASP Security
ASP Syntax
ASP.NET Authentication
ASP.NET Controls
ASP.NET Data Access
ASP.NET Features
ASP.NET Master Pages
ASP.NET Page Events
ASP.NET Security
ASP.NET ViewState
Atom
Certifications
COM, DCOM, COM+
Data Access
E-Mail
Errors
Exporting Data
HTML Tips
IIS
Object-Oriented Programming
RSS
SQL
Uncategorized ASP Tips
VB API Programming
VB Forms
VB Syntax
XML

Book Support
Visual Basic 6 Bible
ASP Bible
ASP Weekend Crash Course
ASP.NET At Work
Creating Web Services

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