Railo 3 : Adding Java CFX Tags

I have a small project that I am working on that needs a Java custom tag that I'm writing. I need this running on ColdFusion 7/8 and Railo 3.

2009-01-07 14:58:00.0

Railo 3 : Adding Java CFX Tags

I have a small project that I am working on that needs a Java custom tag that I'm writing. I need this running on ColdFusion 7/8 and Railo 3.

Adding the CFX to CF is fine and I had no problems, except that its laborious. Having to place the file in the right folder, adding that folder to the Java Classpath and restarting CF Application Server.

Railo is a little different. Infact, its a bit easier once you know.

Everytime Railo starts up it runs through the Railo/lib/ folder and adds all JAR files to the Class Path, saving you the hassle of adding them manually.

You still have to add the CFX tag using the Administrator though.

BTW : Railo 3 Community Administrator doesnt have a CFX option in the menu anymore (V2.0 had it) but you can call the page directly using:

http://localhost/railo-context/admin/web.cfm?action=resources.cfx_tags

Another thing to note is that only Jar libraries are allowed in Railo. I created a simple CFX tag using Eclipse and compiled it to TestTag.class.

In ColdFusion, I was able to place this in a Java Class Path accessible folder, restart the service and add the CFX tag using the Administrator. Bingo, tag ran when called in my CF template.

No way could I get this to work in Railo. Because the class path is built up from a folder on startup that enumerates JAR files, .class files would not get loaded.

To fix this, I exported the CFX to a JAR of its own in Eclipse and did the steps above.

Hopefully this will help someone in the same bind. I love Railo but the lack of documentation is killing me. Gert is very good responding by email but sometimes you need answers right away!

Once I finish this little project, I'll release the Java CFX on my blog. Its going to be cool ;-)

<hint>HTML Diff Tag</hint>

Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [4] - Leave a comment

Comments

Louis Brauer said:
Dan, you saved my life with this blog :-). I was already going to burn my Mac while trying to find out where to place my class files for Railo to find them.

Thanks, mate!

Best regards,
Louis
Prem said:
Dan,

Thank you for your post... I managed to install the trial version of cfx_excel2query on Railo... keep up the good work...
Just a tip Coldfusion or Railo, you will have to restart the server/service for it recognize the java file...
Thank you again,
Prem.
Jeorge Peter said:
I wish you good luck for your project Dan! Hope to hear from your blog soon after you finished this project.
Jeorge Peter said:
This sure helps on those Railo 3 users,Im planning to use this app and I find your blog useful.