帝国软件
  设为首页 加入收藏 关于我们
 
解密帝国网站管理系统
栏 目:
 
您的位置:首页 > 技术文档 > ASP编程
在ASP中使用Java类(Using Java Classes from ASP)
作者: 发布时间:2005-03-12 来源:
Using Java Classes from ASP

COM components aren't the only way to use compiled code in your ASP applications. If you're familiar with
Java, but have no way of wrapping your classes as COM objects (for example, you use JDK or J++ Standard),
you can still use java from ASP. And here's how

First, make sure you have access to the C:<WINDIR>javatrustlib directory on your production server.
Most shared hosting plans wouldn't allow this kind of access, but if you're developing an intranet, or a
site for dedicated server deployment, you'll be just dandy.

Next step, compile your java class as you would compile an applet or console class, using your favourite
compiler, any one will do, and remember to jot down the names of the public methods and properties your
class makes available.

Drop your class file into the trustlib folder, and make sure you have a recent Java Virtual Machine
installed on the server. the latest MS version is here.

Now to call the class from your ASP pages, use the following syntax

set myJavaObject = GetObject("java:classname")
So if you compiled your class as 'foobar.class', you use

set myJavaObject = GetObject("java:foobar")
Generally, the performance of a java class used like this is slightly slower than a COM dll, but faster
than just scripting, and you also have easy access to the inbuilt java class libraries, some of which
you'll find VERY useful in your ASP apps.

Finally, call methods of the object as you would call methods of any other COM component

Happy coding

  
评论】【加入收藏夹】【 】【打印】【关闭
※ 相关链接
 ·较长text型数据无法在Asp页面中取  (2005-03-12)
 ·在ASP中用“正则表达式对象”来校  (2005-03-12)
 ·在ASP中列出数据库中的表名和字段  (2005-03-12)
 ·在ASP中如何将代码生成的文件设为  (2005-03-12)
 ·在ASP里建表  (2005-03-12)
 ·怎样在ASP里面创建统计图表  (2005-03-12)
 ·一次关于ASP变量和对像关闭与不关  (2005-03-12)
 ·在ASP中利用Oracle Object for O  (2005-03-12)
 ·使用XML+VBS技术在ASP中实现报表  (2005-03-12)
 ·自定义用于ASP Web站点的 SQL 7.  (2005-03-12)

   栏目导行
  PHP编程
  ASP编程
  ASP.NET编程
  JAVA编程
   站点最新
·致合作伙伴的欢迎信
·媒体报道
·帝国软件合作伙伴计划协议
·DiscuzX2.5会员整合通行证发布
·帝国CMS 7.0版本功能建议收集
·帝国网站管理系统2012年授权购买说
·PHPWind8.7会员整合通行证发布
·[官方插件]帝国CMS-访问统计插件
·[官方插件]帝国CMS-sitemap插件
·[官方插件]帝国CMS内容页评论AJAX分
   类别最新
·在ASP中使用数据库
·使用ASP脚本技术
·通过启动脚本来感受ASP的力量
·学习使用ASP对象和组件
·解析asp的脚本语言
·初看ASP-针对初学者
·ASP开发10条经验总结
·ASP之对象总结
·ASP与数据库应用(给初学者)
·关于学习ASP和编程的28个观点
 
关于帝国 | 广告服务 | 联系我们 | 程序开发 | 网站地图 | 留言板 帝国网站管理系统