Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use simple Java classes in ASP

Shulou Source: shulou.com Published: 2022-06-02 12:23:39 09月29日 Update

This article mainly introduces how to use simple Java classes in ASP. It is very detailed and has certain reference value. Friends who are interested must finish it!

Method 1: register the Java class as an ActiveX component

Step 1:

Create a Java class named Test.java

Public class Test

{

Public String getword ()

{

Return "Hello World"

}

}

Step 2:

Compile it into a class file, copy it to the system disk: WINNTjavatrustlib directory, and register it as ActiveX component javareg / register / class:Test / progid:Test

Step 3:

Use in ASP

Set obj=Createobject ("Test")'"Test" is the progid at registration.

Msgbox obj.getWord ()

Method 2: use it directly

Step 1:

Establish Test.java

Public class Test

{

Public String getWord ()

{

Return "Hello World"

}

}

Step 2:

Compile it into a class file and copy it to the system disk: WINNTjavatrustlib directory

Step 3: use the

Dim obj

Set obj=GetObject ("java:Test")

Msgbox obj.getWord ()

These are all the contents of the article "how to use simple Java classes in ASP". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Steps content copies files methods directories articles systems components compilation value interests guys buddies that is time more knowledge industry information Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux vpn MySQL Xiaomi Huawei