Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the ColdFusion 9 script syntax for cfsetting?

I'm trying to convert an Application.cfc to script. The original had this:

<cfcomponent displayname="Application" output="false">
     <cfset this.name               = "testing">
     <cfset this.applicationTimeout = createTimeSpan(0,1,0,0)>
     <cfset this.sessionManagement  = true>
     <cfset this.sessionTimeout     = createTimeSpan(0,0,30,0)>

     <cfsetting requesttimeout="20">
     ...

I can't figure out how to convert the cfsetting tag to script. The following attempts don't work:

setting requesttimeout="20"; // throws a "function keyword is missing in FUNCTION declaration." error.
setting( requesttimeout="20" ); // throws a "Variable SETTING is undefined." error.

It looks like Railo may be supporting it (link), but I can't find an equivalent for the cfsetting tag in ColdFusion's documents

like image 870
Micah Avatar asked Nov 08 '11 18:11

Micah


People also ask

How do I declare a variable in ColdFusion?

Syntax. To set a ColdFusion variable, use the <cfset> tag. To output the variable, you need to surround the variable name with hash ( # ) symbols and enclose it within <cfoutput> tags.

How do you set timeout in ColdFusion?

What is it? The Request Timeout setting is located in the Server Settings section of the ColdFusion Administrator. It is the checkbox with "Timeout Requests after (seconds)" next to it.


2 Answers

There isn't one. Normally I'd suggest filing an ER for this, but there already is. What I'd recommend is putting into a CFM file and using include to bring it in.

like image 169
Raymond Camden Avatar answered Sep 17 '22 09:09

Raymond Camden


Give this a try

<cfscript>
createObject( "java", "coldfusion.tagext.lang.SettingTag" ).setRequestTimeout( javaCast( "double", 20 ) );
</cfscript>

or this

<cfscript>
createObject( "java", "coldfusion.runtime.RequestMonitor" ).overrideRequestTimeout( javaCast( "long", 20 ) );
</cfscript>

where 20 is your cfsetting requesttimeout value

like image 35
Mike Causer Avatar answered Sep 20 '22 09:09

Mike Causer