Book Image

Railo 3 Beginner's Guide

By : Mark Drew , Gert Franz, Paul Klinkenberg, Jordan Michaels
Book Image

Railo 3 Beginner's Guide

By: Mark Drew , Gert Franz, Paul Klinkenberg, Jordan Michaels

Overview of this book

<p>Railo Server is one of the quickest ways to start developing complex web applications online. Widely considered as the fastest CFML (ColdFusion Markup Language) engine, Railo allows you to create dynamic web pages that can change depending on user input, database lookups, or even the time of day.</p> <p>Railo 3 Beginner's Guide will show you how to get up and running with Railo, as well as developing your web applications with the greatest of ease. You will learn how to install Railo and the basics of CFML to allow you to gradually build up your knowledge, and your dynamic web applications, as the book progresses.</p> <p>Using Packt’s Beginner's Guide approach, this book will guide you, with step-by-step instructions, through installing the Railo Server on various environments. You will learn how to use caches, resources, Event Gateways and special scripting functions that will allow you to create webpages with limitless functionality. You will even explore methods of extending Railo by adding your own tags to the server and building custom extensions. Railo 3 Beginner's Guide is a must for anyone getting to grips with Railo Server.</p>
Table of Contents (16 chapters)
Railo 3
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface

What else can you do with Railo Server?


This section will outline some of the features that also come with Railo Server and will give you some idea of the power behind it.

CFML compiler

Railo Server has an integrated bytecode generator (written with ASM) that directly compiles CFML written templates into Java bytecode. The compiler is very fast and, on average, it compiles a template file in less than 10 milliseconds.

In early versions, Railo Server translated CFML code into XML, then used XSL to convert it into Java, and finally used a Java compiler to generate bytecode. Since version 2.0, Railo has had an integrated bytecode generator. The compiler is able to spot syntax errors in templates and throw errors accordingly.

Railo archives—compiled code

Railo Server is capable of using Railo archives that are compiled versions of your templates. This allows you to package and distribute your applications without having to worry about other people viewing your code and possibly stealing your intellectual property. In addition, the size of your application decreases drastically and it executes a lot faster (as it is already compiled).

Wide variety of CFML tags and functions

Railo Server has more than 125 tags and over 500 functions that allow you to create the best applications in no time. There are tags and functions for nearly every task you can think of, from manipulating arrays to converting images. The great thing is that Railo Server is also extendable, so you can create your own functions and tags to extend your application or the server itself.

Object-oriented approach

CFML components give you the power you need in order to scale and design MVC-based applications. They allow you to use Object Oriented Programming (OOP) techniques such as methods, encapsulation, and inheritance. This leads to robust, encapsulated code, and, in the long run, reduced maintenance costs.

Scripting support

Railo Server also integrates a scripting version of the tag-based programming language. Programmers who are familiar with the coding syntax of other languages, such as JavaScript, PHP, or JSP, will enjoy this feature.

For example, you can create a component using tags as follows:

<cfcomponent output="false">
<cffunction name="init">
<cfreturn this />
</cffunction>
</cfcomponent>

You can also use the cfscript format to achieve the same thing:

component output=false{
function init(){
return this;
}
}

Integrated administration frontend

With the web and server administrator, Railo Server offers a very easy tool in order to configure the behavior of local and global applications. The Web and Server Administrator applications are the main tools you will use in order to interact with the behavior of Railo. Of course, these applications are also built using CFML. So, you can programmatically adjust all the settings from CFML itself.

Background task execution

Railo Server integrates a task manager that allows you to asynchronously execute requests in the background.

Extension manager

Railo Server tries to include everything you need, but sometimes there are things that are very specific to your application. For this, there is an Extension Manager that allows you to add features to Railo Server directly from the Railo Server Administrator application. The extension store offers programmers a whole new set of features and applications that are easily installed and updated.

Easy update mechanism

Extensions are not the only thing that can be easily updated. You can update Railo Server itself to the latest version with just a click. In the Railo Server administrator, you will get notifications as soon as a new release of Railo Server is available and this allows for a one-click update. If you need to restore the old version again, it is also just one click away. Normally, it is only a matter of seconds.

Compatibility

When developing Railo Server, it was a strict goal to keep compatibility with the CF standard as tightly as possible. This is demonstrated by the fact that with various applications, a change of the application server to Railo did not change anything in the runtime behavior of the application itself, except maybe for the improved speed. So, if you already have some CF applications running, there's no reason to fear high migration costs.

Framework and application compatibility

At the moment, all of the major CFML frameworks or Content Management Systems (CMS) work with Railo Server. So, if you are used to using a framework or tool like FW/1, ColdSpring, ModelGlue, CFWheels, or ColdBox, you don't have to fear incompatibilities. In fact, FW/1 is even written by one of the members of the Railo team, Sean Corfield.

Security

With Railo Server, global security settings can be made for all applications running on the server. For example, access to the filesystem can be denied for a single application or restricted only to files that lie within the web root of the application.

Virtual filesystems

In Railo Server, it is very easy to interact with different virtual filesystems (VFS). The local hard disk is just an instance of a virtual filesystem. Other VFSs that Railo supports are RAM, HTTP, DB, FTP, SFTP, ZIP, TAR, S3, and others.

High performance

Railo Server's main goal was to be the CFML engine with the best performance. One of the main reasons why this goal can be achieved is because Railo uses common resources for all applications. Additional changes in the architecture and various internal structures allowed us to push the performance to higher limits. To the end user, these changes are noticeable in a short response time, during the execution of the same code on the various engines.

Easy installation

The easiest way to give Railo Server a try is to download Railo Express, unpack it, and hit a batch file. There is no easier way to install the software. Railo Server can also be downloaded as an integrated installer for various operating systems and will install Apache Tomcat and add connectors from web servers, such as Microsoft's IIS and the Apache HTTP server.

Inexpensive and free

Railo Server is free and an open source LGPL V2 allowing you to both use and re-distribute your applications with the underlying engine.

When it comes to using Railo Server in a clustered environment, there are some useful and inexpensive extensions that can be purchased. Just use the Railo Extension Manager that is part of the Railo Administration Application in order to see what extensions are available.

Because Railo Server is free, you don't have to fear any update cost or high-initial cost if you plan to use it in a large environment.

Easy clustering

Railo Server makes scaling and clustering very easy. You are able to build independent nodes that act as a virtual cluster and meet any scalability demand your application may have.