Application.cfc / <cfapplication>
Defines a CFML Application and configures the properties / behavior of that Application:
- name
- datasources
- timeouts
- client variable settings
- session settings
- cookies
- and more!
By default, client variables are disabled, and Session and Application variables are stored in memory.
All these settings below can also be configured using the Modern Application.cfc approach, see Application.cfc guide.
These properties can be configured in the Application.cfc constructor
i.e.
this.name = "myApplication";
this.ormsettings.autogenmap = false;
// you can also configure your own custom tag attributes defaults, see [[tags]]
// i.e. this overrides the default log file of "application.log"
// instead this application will write out all default logs to a log file
// named after the Application ( i.e. 'myApplication.log')
this.tag.log.log = this.name & ".log";
To verify your current runtime Application configuration use GetApplicationSettings()
The runtime configuation takes the base server .CFConfig.json / admin configuration, overridden by these Application settings.
This tag cannot have a body.
This tag is also supported within <cfscript>
<cfapplication
name=string
datasource=object
defaultDatasource=object
datasources=struct
logs=struct
mailservers=array
caches=struct
action=create|update
loginStorage=session
clientManagement=boolean
clientStorage=string
sessionType=cfml|j2ee
sessionStorage=string
clientCluster=boolean
sessionCluster=boolean
setClientCookies=boolean
cgiReadonly=boolean
bufferOutput=boolean
sessionManagement=boolean
sessionTimeout=timespan
clientTimeout=timespan
applicationTimeout=timespan
requestTimeout=timespan
setDomainCookies=boolean
scriptProtect=string
proxy=struct
mappings=struct
functionPaths=any
customTagPaths=any
componentPaths=any
secureJson=boolean
wstype=string
typeChecking=boolean
compression=boolean
suppressRemoteComponentContent=boolean
secureJsonPrefix=string
localMode=string
mailListener=any
queryListener=any
SerializationSettings=struct
tag=struct
ormEnabled=boolean
ormSettings=struct
s3=struct
ftp=struct
triggerDataMember=boolean
InvokeImplicitAccessor=boolean
cacheObject=string
cacheFunction=string
cacheQuery=string
cacheTemplate=string
cacheResource=string
cacheInclude=string
cacheHTTP=string
cacheFile=string
cacheWebservice=string
onMissingTemplate=object
locale=locale
timeZone=timezone
webCharset=String
resourceCharset=String
scopeCascading=String
searchImplicitScopes=boolean
searchResults=boolean
authCookie=struct
sessionCookie=struct
enableNULLSupport=boolean
nullSupport=boolean
preciseMath=boolean
psq=boolean
variableUsage=string
cachedAfter=timespan
blockedExtForFileUpload=string
javaSettings=struct
xmlFeatures=struct
regex=any
sameFormFieldsAsArray=boolean
sameURLFieldsAsArray=boolean
showdoc=boolean
showmetric=boolean
showdebug=boolean
debuggingDatabase=boolean
debuggingException=boolean
debuggingDump=boolean
debuggingTracing=boolean
debuggingTimer=boolean
debuggingImplicitAccess=boolean
debuggingQueryUsage=boolean
debuggingThread=boolean
debuggingTemplate=boolean
>
| Attribute | Description | Default |
|---|---|---|
name
string, optional
|
edit
The name of your application. This name can be up to 64 characters long. Required for application and session variables, optional for client variables. By using a different name, i.e. based off cgi.http_host, you can run multiple, separate instances of an application using the same directory / code base. |
|
datasource
object, optional
|
edit
alias for default datasource |
|
defaultDatasource
object, optional
|
edit
the default datasource for this environment |
|
datasources
struct, optional
|
edit
A structure that contains datasources definitions. |
|
logs
struct, optional
|
edit
A structure that contains one or more log definitions. {
"classic": {
"appender":"resource",
"appenderArguments": {
"path" :"{lucee-config}/logs/classic.log"
},
"layout":"classic",
"level":"info"
},
"pattern": {
"appender": "resource",
"appenderArguments": {
"path": "{lucee-config}/logs/pattern.log"
},
"level": "info",
"layout": "pattern",
"layoutArguments": {
"pattern": "%d{yyyy-MM-dd HH:mm:ss,SSS} [%t] %-5p %c - %m%n"
}
}
}
Alias: log |
|
mailservers
array, optional
|
edit
Array of structs that defines the mailserver configuration. Each struct configures one mailserver. Struct keys used for smtp configuration are:
// Example configuration in Application.cfc
this.mailservers = [
{
// You can use any of these keys for the host: 'host', 'server', or 'smtp'
host: 'smtp.some-email-domain.com',
// server: 'smtp.some-email-domain.com',
// smtp: 'smtp.some-email-domain.com', // since Lucee 6.2.2.50-SNAPSHOT
port: 587,
username: 'mymailaccount@some-email-domain.com',
password: 'encrypted:8f7eb9...342',
ssl: false,
tls: true,
lifeTimespan: createTimeSpan(0,0,1,0),
idleTimespan: createTimeSpan(0,0,0,10)
}
];
Alias: mail, mails |
|
caches
struct, optional
|
edit
A structure that contains cache definitions. Alias: cache |
|
action
string, optional
|
edit
The action to perform on the CFML application for the current request
The default value is: create. |
create |
loginStorage
string, optional
|
edit
storage for the login data:
|
|
clientManagement
boolean, optional
|
edit
Yes or No. Enables client variables. Default is No. |
|
clientStorage
string, optional
|
edit
Specifies how Lucee stores client variables:
|
|
sessionType
string, optional
|
edit
Lucee provide 2 kind of sessions:
Default value is defined in the Lucee Web Administrator. "j2ee" can not use a session storage. |
|
sessionStorage
string, optional
|
edit
Specifies how Lucee stores session variables:
|
|
clientCluster
boolean, optional
|
edit
If set to true, lucee uses the storage backend for the client scope as master and Lucee checks for changes in the storage backend with every request. If set to false (default), the storage is only used as slave, lucee only initially gets the data from the storage. Ignored for storage type "memory". |
|
sessionCluster
boolean, optional
|
edit
if set to true, lucee uses the storage backend for the session scope as master and Lucee checks for changes in the storage backend with every request. If set to false (default), the storage is only used as slave, lucee only initially gets the data from the storage. Ignored for storage type "memory". |
|
setClientCookies
boolean, optional
|
edit
Yes or No. Yes enables client cookies. Default is Yes. If you set this attribute to"No", Lucee does not automatically send the CFID and CFTOKEN cookies to the client browser; you must manually code CFID and CFTOKEN on the URL for every page that uses Session or Client variables. |
|
cgiReadonly
boolean, optional
|
edit
if set to true, the CGI Scope is readonly. |
true |
bufferOutput
boolean, optional
|
edit
if set to true (default) the output written to the body of the tag is buffered and in case of an exception also outputted. if set to false the content to body is ignored and not disabled when a failure in the body of the tag occur. |
|
sessionManagement
boolean, optional
|
edit
Yes or No. Yes enables session variables. Default is No. |
|
sessionTimeout
timespan, optional
|
edit
Enter the CreateTimeSpan function and values in days, hours, minutes, and seconds, separated by commas, to specify the lifespan of session variables. The default value is specified in the Variables page of the Lucee Administrator. |
|
clientTimeout
timespan, optional
|
edit
Enter the CreateTimeSpan function and values in days, hours, minutes, and seconds, separated by commas, to specify the lifespan of client variables. The default value is specified in the Variables page of the Lucee Administrator. |
|
applicationTimeout
timespan, optional
|
edit
Sets the lifespan of variables that live in the application scope. Accepts a TimeSpan created using the The default value is defined on the Variables page of the Lucee Administrator. |
|
requestTimeout
timespan, optional
|
edit
Sets the amount of time Lucee will wait for a request to finish before a request timeout will be raised. This means that the execution of the request will be stopped. Alias: timeout |
|
setDomainCookies
boolean, optional
|
edit
Yes or No. Sets the CFID and CFTOKEN cookies for a domain, not just a single host. Applications that are running on clusters must set this value to Yes. The default is No. |
|
scriptProtect
string, optional
|
edit
Specifies whether to protect variables from cross-site scripting attacks. You may specify the string value also as a comma separated list to fine tune protection.
|
|
proxy
struct, optional
|
edit
general proxy that should be used for all connections with the following format: {server:"localhost", port:12345, username:"susi", password: "sorglos"} |
|
mappings
struct, optional
|
edit
A structure that contains mappings. Each element in the structure consists of a key and a value. The logical path is the key and the absolute path is the value. |
|
functionPaths
any, optional
|
edit
Array or String list of paths where you have your functions. |
|
customTagPaths
any, optional
|
edit
Contains custom tag paths. |
|
componentPaths
any, optional
|
edit
Contains component paths. |
|
secureJson
boolean, optional
|
edit
A Boolean value that specifies whether to add a security prefix in front of the value that a function returns in JSON-format in response to a remote call. |
|
wstype
string, optional
|
edit
webservice type used, only the following is supported
|
|
typeChecking
boolean, optional
|
edit
If disabled, Lucee ignores type definitions with function arguments and return values |
true |
compression
boolean, optional
|
edit
Enable compression (GZip) for the Lucee Response stream for text-based responses when supported by the client (Web Browser). |
|
suppressRemoteComponentContent
boolean, optional
|
edit
Suppress content written to response stream when a Component is invoked remotely. Only works if the content was not flushed before. |
|
secureJsonPrefix
string, optional
|
edit
The security prefix to put in front of the value that a function returns in JSON-format in response to a remote call if the secureJSON setting is true. |
|
localMode
string, optional
|
edit
Defines how the local scope of a function is invoked when a variable with no scope definition is used (default value set in the lucee administrator).
|
|
mailListener
any, optional
|
edit
Defines a mail listeners for cfmail See the Mail Listeners for details |
|
queryListener
any, optional
|
edit
Defines a query listeners for cfquery. See the Query Listeners for details |
|
SerializationSettings
struct, optional
|
edit
{
preserveCaseForStructKey: boolean,
preserveCaseForQueryColumn: boolean,
serializeQueryAs: "column|struct|row"
}
Alias: serialization |
|
tag
struct, optional
|
edit
tags/attributes default value in the following structure:
|
|
ormEnabled
boolean, optional
|
edit
Specifies whether ORM should be enabled for the current application context. The default is false. |
|
ormSettings
struct, optional
|
edit
A struct that defines all the ORM settings, the following keys are supported:
|
|
s3
struct, optional
|
edit
A struct that defines default S3 settings, this settings can be overwritten as part of the S3 file path, the following keys are supported:
|
|
ftp
struct, optional
|
edit
A struct that defines default ftp settings, this settings can be overwritten as part of the ftp file path, the following keys are supported:
|
|
triggerDataMember
boolean, optional
|
edit
If there is no accessible data member (property, element of the this scope) inside a component, Lucee searches for available matching "getters" or "setters" for the requested property. The following example should clarify this behaviour. "somevar = myComponent.propertyName". If "myComponent" has no accessible data member named "propertyName", Lucee searches for a function member (method) named "getPropertyName". |
|
InvokeImplicitAccessor
boolean, optional
|
edit
An alias for |
|
cacheObject
string, optional
|
edit
name of the cache used for object caching in this context |
|
cacheFunction
string, optional
|
edit
name of the cache used for function caching in this context |
|
cacheQuery
string, optional
|
edit
name of the cache used for query caching in this context |
|
cacheTemplate
string, optional
|
edit
name of the cache used for template caching in this context |
|
cacheResource
string, optional
|
edit
name of the cache used to store data from ram resource in this context |
|
cacheInclude
string, optional
|
edit
name of the cache used to store data from an include |
|
cacheHTTP
string, optional
|
edit
name of the cache used to store data from a http tag Introduced: 5.0.0.0 |
|
cacheFile
string, optional
|
edit
name of the cache used to store data from file operations Introduced: 5.0.0.0 |
|
cacheWebservice
string, optional
|
edit
name of the cache used to store data from webservice calls Introduced: 5.0.0.0 |
|
onMissingTemplate
object, optional
|
edit
closure/udf executed when the requested template does not exist |
|
locale
locale, optional
|
edit
Sets the country/language locale for CFML processing. The locale value determines the default format of date, time, number, and currency values, according to language and regional conventions. |
|
timeZone
timezone, optional
|
edit
change the timezone definition for the current application context. |
|
webCharset
String, optional
|
edit
character set used for output streams, form-, url-, and cgi scope variables and reading/writing the header |
|
resourceCharset
String, optional
|
edit
character set used for reading from/writing to various resources |
|
scopeCascading
String, optional
|
edit
Depending on this setting Lucee scans certain scopes to find a variable called from the CFML source. This will only happen, when the variable is called without a scope. (Example: #myVar# instead of #variables.myVar#), the following values are supported:
|
|
searchImplicitScopes
boolean, optional
|
edit
alias to the attribute "scopecascading", takes a boolean value where true is equal to "standard" and false is equal to "strict" scope cascading mode. For details see the description for the attribute "scopecascading". |
|
searchResults
boolean, optional
|
edit
When a variable has no scope defined (Example: #myVar# instead of #variables.myVar#), Lucee will also search available resultsets if this is set to true. Alias: searchqueries, searchquery, searchresult Introduced: 5.3.8.19 |
|
authCookie
struct, optional
|
edit
cfauthorization cookie behaviour |
|
sessionCookie
struct, optional
|
edit
A struct which defines session cookie behaviour; the following keys are supported:
|
|
enableNULLSupport
boolean, optional
|
edit
Enable Full Null support |
|
nullSupport
boolean, optional
|
edit
enable or disable full null support |
|
preciseMath
boolean, optional
|
edit
If set to true Lucee increases memory size for arithmetic operations and numbers. This improves the accuracy of floating point calculations. Introduced: 6.0.0.114 |
|
psq
boolean, optional
|
edit
preserve single quote in injected variables into cfquery. |
|
variableUsage
string, optional
|
edit
how to handle variable usage within cfquery, possible values are
|
|
cachedAfter
timespan, optional
|
edit
set the timespan for the attribute "cachedAfter" from tag "query". |
|
blockedExtForFileUpload
string, optional
|
edit
A comma separated list of file extensions that will be blocked for File Upload operation |
|
javaSettings
struct, optional
|
edit
A struct that enables loading of application-specific Java libraries from a custom path. The following keys are supported:
Introduced: 5.3.3.37 |
|
xmlFeatures
struct, optional
|
edit
Allows to set XML Features to prevent XXE attacks
Introduced: 5.3.4.51 |
|
regex
any, optional
|
edit
A struct containing the configuration for regular expressions ATM only the key "engine" is supported Engines:
i.e.
Introduced: 5.3.8.23 |
|
sameFormFieldsAsArray
boolean, optional
|
edit
Default False When true, form fields with the same name will be combined into an array. This only works via Application.cfc |
|
sameURLFieldsAsArray
boolean, optional
|
edit
Default False When true, url fields/parameters with the same name will be combined into an array. This only works via Application.cfc |
|
showdoc
boolean, optional
|
edit
Show documentation output at the end of the webpage or not. Alias: doc Introduced: 6.1.0.155 |
|
showmetric
boolean, optional
|
edit
Show metric output at the end of the webpage or not. Alias: metric Introduced: 6.1.0.155 |
|
showdebug
boolean, optional
|
edit
Show debug output at the end of the webpage or not. Alias: debug Introduced: 6.1.0.155 |
|
debuggingDatabase
boolean, optional
|
edit
Log debugging information from the queries in the request Introduced: 6.1.0.156 |
|
debuggingException
boolean, optional
|
edit
Log debugging information from the exceptions in the request Introduced: 6.1.0.156 |
|
debuggingDump
boolean, optional
|
edit
Log debugging information from the dump tag in the request Introduced: 6.1.0.156 |
|
debuggingTracing
boolean, optional
|
edit
Log debugging information from the trace tag in the request Introduced: 6.1.0.156 |
|
debuggingTimer
boolean, optional
|
edit
Log debugging information from the timer tag in the request Introduced: 6.1.0.156 |
|
debuggingImplicitAccess
boolean, optional
|
edit
Log debugging information about unscoped variables accessed in the request Introduced: 6.1.0.156 |
|
debuggingQueryUsage
boolean, optional
|
edit
Log debugging information about which columns in queries are used the request Introduced: 6.1.0.156 |
|
debuggingThread
boolean, optional
|
edit
Log debugging information about threads used in the request Introduced: 6.1.0.156 |
|
debuggingTemplate
boolean, optional
|
edit
Log debugging information about templates used in the request Introduced: 6.1.0.156 |
Examples
editThere are currently no examples for this tag.
See also
- Application
- Core CFML Language
- Scopes
- Session
- Application.cfc guide
- Breaking Changes between Lucee 6.2 and 7.0
- Adding Caches via Application.cfc
- Configuration - CFConfig.json
- ApplicationPathCacheClear()
- ApplicationStop()
- GetApplicationMetadata()
- GetApplicationSettings()
- SessionCommit()
- SessionExists()
- SessionInvalidate()
- SessionRotate()
- JavaSettings in Application.cfc, Components and CFConfig.json
- Mail Listeners
- Component Mappings
- Custom Tag Mappings
- Define a mapping
- Request Timeout
- REST Services with Lucee
- Setting System Properties and Environment Variables
- Session Handling in Lucee
- Update current Application Context
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)