An Architect's View

CFML, Clojure, Software Design, Frameworks and more...

An Architect's View

Railo 4.2, Tomcat 7, Clojure - how simple could it be?

June 1, 2013 · 4 Comments

Thanks to Shantanu Kumar, if you have Leiningen installed for Clojure development, creating a skeleton web application based on Railo 4.2.0 and Tomcat 7 that blends CFML and Clojure is as simple as running these commands:

  • lein new lein-servlet railo myapp
  • cd myapp
  • lein servlet run

At this point you have a mixed CFML/Clojure web application running on port 3000 and you'll be seeing the home page in your browser!

The first time you run the application, it will take a while to download all of the libraries, but once those are cached locally, it will start up pretty quickly.

Shantanu's Leiningen plugin doesn't use cfmljure so Clojure integration into CFML is fairly low-level but as a way to get a mixed CFML/Clojure environment up and running on the latest Railo release, this really can't be beat!

If you want to see these commands in action, here's a short screencast I recorded [requires Safari - but it will play on iPhone / iPad as well as Windows and Mac with Safari!] showing the whole process end-to-end (including my inability to type 'cd' correctly!). This is a 'first run' so you see the full download of all the Railo / Tomcat libraries but it will give you a flavor of the simplicity involved.

Tags: cfmljure · coldfusion · railo

4 responses so far ↓

  • 1 Martin // Jun 2, 2013 at 12:41 AM

    Video does not play for me.
  • 2 Barney // Jun 2, 2013 at 9:05 AM

    Hey Sean,

    Since Leiningen uses Maven repositories under the hood, Railo 4.2 must be resolvable there, right? I can't find the dependency reference in the lein-servlet flavor code. Is there an official location to get Railo through Maven now (e.g., Maven Central)? Because that'd be awesome.
  • 3 Johnny // Jun 5, 2013 at 5:01 AM

    Your video doesn't play at all. Can you please check it out?
  • 4 Sean Corfield // Jun 10, 2013 at 6:14 PM

    @Martin, @Johnny, Looks like it requires Safari. I'll update the entry to note that. It runs fine on iPhone / iPad, as well as Safari on both Mac and Windows 8 :) It was produced with QuickTime and exported to various web formats so I'm a little surprised it

    @Barney, I don't know how official the Maven repo is for Railo - it's community-maintained. Once you've generated your new Railo project with Leiningen, you'll see the dependencies in project.clj - so you can find them in the source tree's template for that file:

    https://github.com/kumarshantanu/lein-servlet/blob/master/lein-template/src/leiningen/new/lein_servlet/flavor/railo/project.clj.tpl

Leave a Comment

Leave this field empty