开发者

calling user defined java class within cfml

How do i call a jar file provided using CFML?

I tried using createObject() method but I am confused about the path.

Is it the class path or jar file path?

Where I have to place the .jar file?

Do I need t开发者_StackOverflowo load the .jar file on Blue Dragon server?

Thanks,


In order to use custom jar files you need to copy them into specific directory in ColdFusion - a classpath. It depends on the setup but usually it's located here:

#server.ColdFusion.ROOTDIR#\lib\

Then you need to restart the CF server.

Here's some guide on doing it: http://blogs.adobe.com/cantrell/archives/2004/07/the_definitive.html

If you're planning on using more jar files it could be usefull to use some library like JavaLoader - then you can load any jar withouth the need of restarting CF.


I suggest http://javaloader.riaforge.org/ for loading java object. It gives lots of flexibility like you do not need to store your class file in web-inf or doesn't need to map directory.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜