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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP Calling java class. 1

Status
Not open for further replies.

rranjan

Programmer
Aug 2, 2000
3
0
0
US
can i use java classes in asp without copying it&nbsp;&nbsp;to trustlib ?&nbsp;&nbsp;Most of the&nbsp;&nbsp;Web hoster will not allow to copy the class file in trustlib&nbsp;&nbsp;directory&nbsp;&nbsp;...<br>
 
Dear rranjan,<br><br>Java class files need to execute inside a Java VM. ASP does not run inside a VM as far as I know. (Can anyone correct me on this if I'm wrong, I would certianly take advantage of that if it could be done.)<br><br>So if my understanding is correct, even if you put the file anywhere you can't use it in ASP code.<br><br>-pete
 
As long as u are using IIS, the following works.<br><br>ASP supports objects of all types. A special classid can be found from MSDN , microsoft which pertain to including .class files as objects. These are called monikers. Put this classid in the Object Tag.<br><br>Give it an id. Suppose your class, which can be in any path, as long as U register it(THRU REGEDIT or REGEDT32), has a method called doIt(). THen lets say ur object has an id &quot;abc&quot;.<br><br>U can call abc.doIt() easily.<br><br>But the pre-requisites are to register the .class file u are using to a particular classid ( which u can set) I think.<br>For more details, refer MSDN.
 
Dear Palbano and Methegreat,<br>&nbsp;&nbsp;&nbsp;Thanks a lot.<br>&nbsp;&nbsp;&nbsp;Palbano, As Methegreat suggestes we can use java monikers to access the java class. <br>&nbsp;&nbsp;&nbsp;As i know about monikers and correct me if i am wrong , it can call an&nbsp;&nbsp;object ( using getObject(java:path/classfile)). I tried it and it&nbsp;&nbsp;doesn't work&nbsp;&nbsp;not at least with PWS. It works if i copy the class file to trustlib dir&nbsp;&nbsp;even without registering it. It doedn't work&nbsp;&nbsp;without copying it to tustlib, no matter whether it is registered&nbsp;&nbsp;or not.<br>Thanks.<br>Rajiv.&nbsp;&nbsp;<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top