Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to invoke a java class from ASP code?

Status
Not open for further replies.

kris2002

IS-IT--Management
May 14, 2003
21
US
I am new to ASP and Java. Please help me.

1) I would like to know if there is a way to invoke a java class from ASP code.

2) Is it better to have the ASP code and Java code in different boxes or in the same box?

Thanks in advance.

- Kris
 
To my knowledge you can't access Java code from ASP. You could build an application in Java and have ASP interact with it in some fashion, for instance having ASP execute a java program from command-line then reading back the resulting output, or by having a java app rtunning in the backgroudn that ASP could communicate with via sockets.
But as far as ASP instantiating a Java class, can't do it.

On the other hand, JSP is Java based and does the same thing as ASP, so you might want to look into using that instead.

barcode_1.gif
 
Tarwn

thats not correct, you can instanciate a java class from ASP:

myObj=GetObject("java:myclass");

My question is, if your class has a constructor which needs some parameters, how do you make the call to the class? I get an error if i do the following:

myObj=GetObject("java:myclass(params)");

thanxs!
alej

 
Ok, I spent a little time researching this. Your correct that you can treat Java class files as COM objects now (sorta). Unfortunatly everything I have read about the two methods to do this (oine using javareg the other using the java: prefix) says that you cannot use arguments in the constructors.

Thanks for pointing this out. it seems like the documentatioj available out on the web is extremely limited, with most of it seeming to be third party apps that do the same thing or DCom methods to do this. Do you know of anywhere to get more info on this?

barcode_1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top