Conditionals execute certain code that meet specific conditions
if (someColor == blue) {
In the Tomcat folder create a railo/
folder and copy in the contents of the unzipped Railo JARs ZIP file (or from the WEB-INF/lib/
folder of the unzipped Railo WAR file). In the Tomcat conf/
folder, edit catalina.properties
and find the common.loader
class path. We're going to add the Railo JARs to the common class path so that every web application can have Railo CFML pages. The new common.loader
definition should look like this (all on one line, no spaces):
common.loader=${catalina.home}/lib,${catalina.home}/lib/*.jar,${catalina.home}/railo,${catalina.home}/railo/*.jar
Note: embedding Railo directly in Tomcat like this means that you will end up with a generated WEB-INF/
folder in each webroot, containing some Railo files (about 2MB).
Unless you're going to use the default web applications that come with Tomcat, this is a good time to empty the Tomcat webapps/
folder. You could create a default/
folder in the Tomcat folder and move everything from webapps/
to default/
And yes, new
has one crucial disadvantage, ably described by other answers: if you forget to use it, your code will break without warning. Fortunately, that disadvantage is easily mitigated - simply add a bit of code to the function itself:
function foo()
{
// if user accidentally omits the new keyword, this will
// silently correct the problem...
if ( !(this instanceof foo) )
return new foo();
// constructor logic follows...
<!--- | |
Name: intake_xml.cfm | |
Author: Gernot Bartels | |
Description: Intake Application cfsavecontent object | |
Returns new record or update data. | |
History: Created | |
Usage: Surveys, Intake, | |
Created: 2012-09-05 | |
Updated: 2012-10-15 | |
---> |
<!--- | |
Name: record.cfm | |
Author: Gernot Bartels | |
Description: Queries QB for record object. | |
If record ID exists, update; | |
Otherwise create new record. | |
History: Created | |
Added logic | |
Usage: Surveys, Intake, | |
Created: 2011-08-05 |