Coldfusion *inside* Java?
- 0
- Add a Comment
- No Related Post
Speaking as someone that knows less about Coldfusion I’d like to admit, I must say that when I first stumbled upon this article about CF inside of Java -well, let’s just say I was taken back some…
Most people know by now that CF offers very tight java integration… it’s rather rare that I have to write a wrapper class in java that is callable by CF (usually only java classes with lots of overloaded methods pose difficulty).
To make a long story short, one of the main things I’m doing with the large java app (that I mentioned in my previous post) is trying to integrate *legacy* apps/services. Of course, these apps/services are written in CF. While a robust webservices API is on the roadmap, it’s still several months off and I needed something quick & dirty.
One of the quirky aspects of the java app is that it completely overtakes Tomcat, with modules residing in separate webapps, and core functionality spread across all webapps (one reason why Spring is so great in that situation… you can have a core set of services that are then seamlessly combined with module-specific ones). I’m not too up-to-snuff on the architecture, but I’ve heard the cross-context stuff is something that really only works well in tomcat.
Anyways, I had done some successful integration calling CF webservices from java, but I really wanted to run coldfusion code in the same container as java. So, just as a crossed-fingers test, I deployed cf as .war to the same Tomcat, and low and behold it just plain *works*!!!! The java app provides a “tunnel” servlet, which allows the main-app to know about any request to a “sub-app”. As long as I hit it like /tunnel/cfusion/myApp.cfm, my cf code can see two VERY important things:
