has had the occasional forays into Perl, ASP, PHP, Rails, and Java, he is still loving ..... Whenever you use a programm
Railo 3 Beginner's Guide
Mark Drew Gert Franz Paul Klinkenberg Jordan Michaels
Chapter No. 1 "Introducing Railo Server"
In this package, you will find: A Biography of the authors of the book A preview chapter from the book, Chapter NO.1 "Introducing Railo Server" A synopsis of the book’s content Information on where to buy this book
About the Authors Mark Drew has been developing web applications for a number of clients since the mid 90s. He has been using ColdFusion and writing in CFML since 1996, and even though he has had the occasional forays into Perl, ASP, PHP, Rails, and Java, he is still loving every line of code he has written in CFML. Mark has been part of the CFEclipse Project developing a CFML IDE and Project Manager for the Reactor ORM Project, as well as contributor to a number of frameworks. His career has concentrated on e-commerce, web content management, and application scalability for various well-known brands in the UK as well as the rest of the world. Mark is also a well-known speaker at various conferences on subjects close to his heart, such as ORMs, Frameworks, Development Tooling and Process, as well as noSQL > Private bank account No.: #bank.accountNr# Show secret information
The highlighted code above shows you some CFML (or Railo Template) code. This code is dynamic and will run on the server before returning the rendered HTML back to the browser that requested the page. If you are used to reading HTML code, you can easily figure out what the previous code is supposed to do. (It displays the HTML between the tags if the variable loggedIn in the SESSION is true.)
[8]
For More Information: www.packtpub.com/railo-3-beginners-guide-to-develop-deploy-complexapplications-online/book
Chapter 1
What does Railo Server do? Railo Server is a service that can be installed on any Java Applica on Server (http://en.wikipedia.org/wiki/Java_Servlet) that helps you write web applica ons quickly and easily, without the complexi es normally associated with developing fast, scalable, and secure applica ons in Java. Railo Server is a servlet that runs on any servlet engine. Servlets are small (or large) programs that are invoked by a servlet engine or a J2EE applica on server (such as Tomcat, JRun, Je y, Resin, Glassfish, IBM WebSphere, BEA WebLogic, and others). The applica on servers run within the Java Run me Environment (JRE) and call the corresponding servlet; if a certain request comes to it, it matches certain condi ons. If this is the first me you are hearing about servlets, JREs, and similar things, no need to worry, Railo Server can be installed with an easy installer for a complete setup. It installs the JRE, the servlet engine, and can even hook into an exis ng IIS or Apache web server. What the servlet does is completely open. In this case, the Railo Servlet allows us to do the following:
Compile CFM files into Java bytecode
Check the syntax of invoked files
Invoke the necessary files according to the CFML syntax
Execute the bytecode and throw any errors that may occur
Build up a request environment
Interact with external resources, including:
to="Ramona Recipient " subject="Hi!"> Hi, How are you? [ 12 ]
For More Information: www.packtpub.com/railo-3-beginners-guide-to-develop-deploy-complexapplications-online/book
Chapter 1
As you see, this is a lot of func onality with very li le code! Another compara ve example would be the number of lines of code required to create a web service. This shows you how Railo Server really can speed up your development: PHP:25 lines Java:16 lines Railo:1 line In terms of produc vity, Railo Server is very powerful and can match any other programming language in performance and especially in conciseness, as we will discover with many of the examples in this book. In addi on, Railo Server lets you manage your resources such as >
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 applica ons. The Web and Server Administrator applica ons are the main tools you will use in order to interact with the behavior of Railo. Of course, these applica ons are also built using CFML. So, you can programma cally adjust all the se ngs from CFML itself.
[ 15 ]
For More Information: www.packtpub.com/railo-3-beginners-guide-to-develop-deploy-complexapplications-online/book
Introducing Railo Server
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 some mes there are things that are very specific to your applica on. For this, there is an Extension Manager that allows you to add features to Railo Server directly from the Railo Server Administrator applica on. The extension store offers programmers a whole new set of features and applica ons 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 no fica ons 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 ma er of seconds.
Compatibility When developing Railo Server, it was a strict goal to keep compa bility with the CF standard as ghtly as possible. This is demonstrated by the fact that with various applica ons, a change of the applica on server to Railo did not change anything in the run me behavior of the applica on itself, except maybe for the improved speed. So, if you already have some CF applica ons running, there's no reason to fear high migra on 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 incompa bili es. In fact, FW/1 is even wri en by one of the members of the Railo team, Sean Corfield.
Security With Railo Server, global security se ngs can be made for all applica ons running on the server. For example, access to the filesystem can be denied for a single applica on or restricted only to files that lie within the web root of the applica on.
[ 16 ]
For More Information: www.packtpub.com/railo-3-beginners-guide-to-develop-deploy-complexapplications-online/book
Chapter 1
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 applica ons. Addi onal changes in the architecture and various internal structures allowed us to push the performance to higher limits. To the end user, these changes are no ceable in a short response me, during the execu on 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 so ware. Railo Server can also be downloaded as an integrated installer for various opera ng systems and will install Apache Tomcat and add connectors from web servers, such as Microso '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 applica ons 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 Administra on Applica on in order to see what extensions are available. Because Railo Server is free, you don't have to fear any update cost or high-ini al 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 applica on may have.
[ 17 ]
For More Information: www.packtpub.com/railo-3-beginners-guide-to-develop-deploy-complexapplications-online/book
Introducing Railo Server
Summary Hopefully, this chapter has given you an overview of what Railo Server offers the web developer in terms of ease of programming, conciseness of language, and feature set. You should now have an idea of:
The small number of lines you need to write to get things done
The rich number of features that Railo Server provides
How easy it is to extend Railo Server by using extensions
The way templates are processed and delivered to the client
The powerful Java underpinnings that are made available to you without any complexity
In the next chapter, we shall have a look at the various ways you can install Railo Server and how to get up and running quickly under different environments.
[ 18 ]
For More Information: www.packtpub.com/railo-3-beginners-guide-to-develop-deploy-complexapplications-online/book
Where to buy this book You can buy Railo 3 Beginner's Guide from the Packt Publishing website: http://www.packtpub.com/railo-3-beginners-guide-to-developdeploy-complex-applications-online/book. Free shipping to the US, UK, Europe and selected Asian countries. For more information, please read our shipping policy.
Alternatively, you can buy the book from Amazon, BN.com, Computer Manuals and most internet book retailers.
www.PacktPub.com
For More Information: www.packtpub.com/railo-3-beginners-guide-to-develop-deploy-complexapplications-online/book