web-applicationsrailocfml

How to start programming CFML with Railo


I believe I am missing something big and obvious here. I have decided to start learning CFML. I installed the open source Railo Server and am saving to the correct path to run the cfm files from. When I run a file, it shows the HTML but not the CFML e.g.

I get this output

#variable1#

from this simple hello world code in notepad++:

<html>
    <head><title>Hello World</title></head>
    <body>
        <cfset variable1 = "hello world">
        <cfoutput>#variable1#</cfoutput>
    </body>
</html>

I am treating the running of cfm files as I would PHP files. I believed it was the same idea. I can't find any tutorials that use Railo and notepad (perhaps because I have misunderstood the whole thing?). Most tutorials I have seen use adobe or dreamweaver, neither of which I have access to.

Cheers


Solution

  • The Railo Company was dissolved in 2016. The links below may no longer function

    The simplest way to get up and running is following these steps:

    1) Goto the download page https://web.archive.org/web/20130106224650/http://www.getrailo.org/index.cfm/download/ and get the "Express with JRE edition" for your OS.

    e.g. For Windows, select select railo-express-4.0.2.002-jre-win32.zip

    2) Unzip the archive to a suitable location.

    3) Execute the start.bat file (i.e. double-click it) to launch the Jetty servlet engine which Railo runs within.

    4) Open a browser and go to http://localhost:8888/ - you should get a "Welcome to Railo" screen.

    5) In your Railo directory, go into webapps, then into railo, and you'll see the index.cfm which powers the above message. Rename it to something else, e.g. orig.index.cfm and go ahead and place the code above in a new index.cfm

    6) Refresh the browser and you will see the "hello world" output you expect.

    You can of course replace steps 1..3 with getting the Tomcat Installer and using that - it's a perfectly valid option, just takes more time to setup, whilst also being more convenient if connecting to an external web server.
    (Both Tomcat and Jetty are fully capable servlet engines able to power whatever you throw at them; neither require a distinct web server, but there are instances when adding one is beneficial.)