频道直达 - 学院 - 下载 - 交易 - 特效 - 字库 - 手册 -排名-工具- 繁體
网页教学网站开发 设为首页
加入收藏
联系我们
建站搜索: 常用广告代码   用户注册 | 用户登陆
您当前的位置:中国建站之家 -> 网站开发设计技术教程 -> asp教程 -> 在ASP中使用Java类(Using Java Classes from ASP)

在ASP中使用Java类(Using Java Classes from ASP)

作者:未知  来源:转载  发布时间:2005-9-17 21:07:43  发布人:acx

减小字体 增大字体

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>\java\trustlib\ 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


将本文收藏到QQ书签与更多好友分享
[打 印]
[] [返回上一页] [收 藏]
∷相关文章评论∷    (评论内容只代表网友观点,与本站立场无关!) [更多评论...]
精彩推荐
热门文章
· 注册码大全二
· 注册码大全四
· 注册码大全一
· 要10G免费网络硬盘的请进..
· 通过google 赶快来赚美金..
· 注册码大全十
· 头像-qq头像(qq新头像)4..
· 让你轻松架设FTP服务器1..
· 注册码大全三
· 梦幻背景图片7
· 卡通动物图片6
· 网页制作素材-按钮素材2..
· 让你轻松架设FTP服务器5..
· 风景图片8
· 注册码大全九
· 让你轻松架设FTP服务器2..
关注此文读者还看过
· 马云整合供应链 阿里巴巴..
· 让你的Smarty更聪明
· JavaScript教程:JavaSc..
· MySQL数据库技术(15)
· PHP 开发中的中文编码问..
· 上网不用防火墙.!一招克..
· Photoshop照片美容揭密 ..
· 通过ASP与ACCESS数据库建..
· 分页控件源代码--组合..
· Flash制作函数曲线课件(..
· W3 Jmail 参考说明
· 桌面中心(二) 数据库写入..
· Fireworks教程:制造炫彩..
· 圈圈浅谈推广所普遍存在..
· JScript 方法 - charAt ..
· 解析年方十八“震荡波”..
相关文章
· ASP教程,ASP实现防盗链的方..
· 提高ASP的速度的方法:GetS..
· ASP.NET连接Access和SQL Se..
· 初学:ASP内建对象Response
· Asp.net中防止用户多次登录..
· ASP.NET 与 Ajax 的实现方式..
· ASP.net平台社区软件Discuz..
· ASP技巧:让Len,Left,Right..
· ASP操作数据库的类
· ASP.NET AJAX中的异步..
· 如何编写通用的ASP防SQL注入..
· 网页输出N行N列表格的ASP实..
· 汉字转拼音ASP函数
· ASP实例:检测整数和长整数..
· ASP教程:等差数列和等比数..
· ASP技巧:rs.getrows方法
关于本站 - 网站帮助 - 广告合作 - 下载声明 - 友情连接 - 网站地图 - 人才招聘
网站合作、内容监督、商务咨询:QQ: 9576619
Copyright ? 2005--2008 中国建站之家版权所有
粤ICP备05092265号