|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
写软件都是想的时间比写的时间要长的.如果反过来了就得看看是什么原因了.另外大家可以回去问问公司里的小MM.(一般企业里,跟你们交付软件接触得最多的是她们)UsingJavaClassesfromASP
COMcomponentsarenttheonlywaytousecompiledcodeinyourASPapplications.Ifyourefamiliarwith
Java,buthavenowayofwrappingyourclassesasCOMobjects(forexample,youuseJDKorJ++Standard),
youcanstillusejavafromASP.Andhereshow
First,makesureyouhaveaccesstotheC:<WINDIR>java rustlibdirectoryonyourproductionserver.
Mostsharedhostingplanswouldntallowthiskindofaccess,butifyouredevelopinganintranet,ora
sitefordedicatedserverdeployment,youllbejustdandy.
Nextstep,compileyourjavaclassasyouwouldcompileanappletorconsoleclass,usingyourfavourite
compiler,anyonewilldo,andremembertojotdownthenamesofthepublicmethodsandpropertiesyour
classmakesavailable.
Dropyourclassfileintothe rustlibfolder,andmakesureyouhavearecentJavaVirtualMachine
installedontheserver.thelatestMSversionishere.
NowtocalltheclassfromyourASPpages,usethefollowingsyntax
setmyJavaObject=GetObject("java:classname")
Soifyoucompiledyourclassasfoobar.class,youuse
setmyJavaObject=GetObject("java:foobar")
Generally,theperformanceofajavaclassusedlikethisisslightlyslowerthanaCOMdll,butfaster
thanjustscripting,andyoualsohaveeasyaccesstotheinbuiltjavaclasslibraries,someofwhich
youllfindVERYusefulinyourASPapps.
Finally,callmethodsoftheobjectasyouwouldcallmethodsofanyotherCOMcomponent
</p>ASP一般认为只能运行在IIS上,正如前面所提到的,这并不是十分正确,事实上,ASP也能运行在Apache上。ApacheASP可在任意Apache服务器上运行有限的ASP功能,所需做的,只需打开mod_perl。 |
|