Ask Ben: Dynamically Executing ColdFusion Application.cfc Instances

<cfcomponent
	output="false"
	hint="I define application settings for APP 2.">
 
	<!--- Define application settings. --->
	<cfset THIS.Name = "SubAppTwo" />
	<cfset THIS.ApplicationTimeout = CreateTimeSpan( 0, 0, 5, 0 ) />
 
	<!--- Define request settings. --->
	<cfsetting showdebugoutput="false" />
 
 
	<cffunction
		name="OnRequestStart"
		access="public"
		returntype="boolean"
		output="false"
		hint="I run before the requested template gets processed.">
 
		<!--- Define arguments. --->
		<cfargument
			name="Page"
			type="string"
			required="true"
			hint="I am the requested page."
			/>
 
		<!--- Set up DSN. --->
		<cfset REQUEST.DSN = {
			Source = "app2_dsn",
			Username = "app2_user",
			Password = "donkey"
			} />
 
		<!--- Set up mode. --->
		<cfset REQUEST.Mode = "Production" />
 
		<!--- Return out. --->
		<cfreturn true />
	</cffunction>
 
</cfcomponent>

For Cut-and-Paste