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 Create an Application.cfc.
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";
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=cookie|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
|
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
|
alias for default datasource |
|
defaultdatasource
object, optional
|
the default datasource for this environment |
|
datasources
struct, optional
|
A structure that contains datasources definitions. |
|
logs
struct, optional
|
A structure that contains log definitions. Alias: log |
|
mailservers
array, optional
|
Array of structs that defines the mailserver configuration. Each struct configures one mailserver. Struct keys used for smtp configuration are: - host (string): host name of smtp server - port (numeric): port number of smtp server - username (string): smtp username - password (string): smtp userpassword - ssl (boolean): enable secure connections via SSL. - tls (boolean): enables Transport Layer Security. - lifeTimespan (timespan): overall timeout for the connections established to the mail server. - idleTimespan (timespan): idle timeout for the connections established to the mail server. Alias: mail, mails |
|
caches
struct, optional
|
A structure that contains cache definitions. Alias: cache |
|
action
string, optional
|
The action to perform on the CFML application.
The default value is: create. |
create |
loginstorage
string, optional
|
storage for the login data:
|
|
clientmanagement
boolean, optional
|
Yes or No. Enables client variables. Default is No. |
|
clientstorage
string, optional
|
Specifies how Lucee stores client variables:
|
|
sessiontype
string, optional
|
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
|
Specifies how Lucee stores session variables:
|
|
clientcluster
boolean, optional
|
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
|
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
|
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
|
if set to true, the CGI Scope is readonly. |
true |
bufferoutput
boolean, optional
|
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
|
Yes or No. Yes enables session variables. Default is No. |
|
sessiontimeout
timespan, optional
|
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
|
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
|
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
|
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
|
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
|
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
|
general proxy that should be used for all connections with the following format: {server:"localhost", port:12345, username:"susi", password: "sorglos"} |
|
mappings
struct, optional
|
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
|
Array or String list of paths where you have your functions. |
|
customtagpaths
any, optional
|
Contains custom tag paths. |
|
componentpaths
any, optional
|
Contains component paths. |
|
securejson
boolean, optional
|
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
|
webservice type used, only the following is supported
|
|
typechecking
boolean, optional
|
If disabled, Lucee ignores type definitions with function arguments and return values |
true |
compression
boolean, optional
|
Enable compression (GZip) for the Lucee Response stream for text-based responses when supported by the client (Web Browser). |
|
suppressremotecomponentcontent
boolean, optional
|
Suppress content written to response stream when a Component is invoked remotely. Only works if the content was not flushed before. |
|
securejsonprefix
string, optional
|
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
|
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
|
Defines a mail listeners for cfmail See the Mail Listeners for details |
|
querylistener
any, optional
|
Defines a query listeners for cfquery. See the cookbooks-query-listeners for details |
|
serializationsettings
struct, optional
|
Alias: serializationsetting |
|
tag
struct, optional
|
tags/attributes default value in the following structure:
|
|
ormenabled
boolean, optional
|
Specifies whether ORM should be enabled for the current application context. The default is false. |
|
ormsettings
struct, optional
|
A struct that defines all the ORM settings, the following keys are supported:
|
|
s3
struct, optional
|
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
|
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
|
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
|
An alias for |
|
cacheobject
string, optional
|
name of the cache used for object caching in this context |
|
cachefunction
string, optional
|
name of the cache used for function caching in this context |
|
cachequery
string, optional
|
name of the cache used for query caching in this context |
|
cachetemplate
string, optional
|
name of the cache used for template caching in this context |
|
cacheresource
string, optional
|
name of the cache used to store data from ram resource in this context |
|
cacheinclude
string, optional
|
name of the cache used to store data from an include |
|
cachehttp
string, optional
|
name of the cache used to store data from a http tag Introduced: 5.0.0.0 |
|
cachefile
string, optional
|
name of the cache used to store data from file operations Introduced: 5.0.0.0 |
|
cachewebservice
string, optional
|
name of the cache used to store data from webservice calls Introduced: 5.0.0.0 |
|
onmissingtemplate
object, optional
|
closure/udf executed when the requested template does not exist |
|
locale
locale, optional
|
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
|
change the timezone definition for the current application context. |
|
webcharset
String, optional
|
character set used for output streams, form-, url-, and cgi scope variables and reading/writing the header |
|
resourcecharset
String, optional
|
character set used for reading from/writing to various resources |
|
scopecascading
String, optional
|
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
|
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
|
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
|
cfauthorization cookie behaviour |
|
sessioncookie
struct, optional
|
A struct which defines session cookie behaviour; the following keys are supported:
|
|
enablenullsupport
boolean, optional
|
||
nullsupport
boolean, optional
|
enable or disable full null support |
|
precisemath
boolean, optional
|
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
|
preserve single quote in injected variables into cfquery. |
|
variableusage
string, optional
|
how to handle variable usage within cfquery, possible values are
|
|
cachedafter
timespan, optional
|
set the timespan for the attribute "cachedAfter" from tag "query". |
|
blockedextforfileupload
string, optional
|
A comma separated list of file extensions that will be blocked for File Upload operation |
|
javasettings
struct, optional
|
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
|
Allows to set XML Features to prevent XXE attacks
Introduced: 5.3.4.51 |
|
regex
any, optional
|
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
|
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
|
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
|
Show documentation output at the end of the webpage or not. Alias: doc Introduced: 6.1.0.155 |
|
showmetric
boolean, optional
|
Show metric output at the end of the webpage or not. Alias: metric Introduced: 6.1.0.155 |
|
showdebug
boolean, optional
|
Show debug output at the end of the webpage or not. Alias: debug Introduced: 6.1.0.155 |
|
debuggingdatabase
boolean, optional
|
Introduced: 6.1.0.156 |
|
debuggingexception
boolean, optional
|
Introduced: 6.1.0.156 |
|
debuggingdump
boolean, optional
|
Introduced: 6.1.0.156 |
|
debuggingtracing
boolean, optional
|
Introduced: 6.1.0.156 |
|
debuggingtimer
boolean, optional
|
Introduced: 6.1.0.156 |
|
debuggingimplicitaccess
boolean, optional
|
Introduced: 6.1.0.156 |
|
debuggingqueryusage
boolean, optional
|
Introduced: 6.1.0.156 |
|
debuggingthread
boolean, optional
|
Introduced: 6.1.0.156 |
|
debuggingtemplate
boolean, optional
|
Introduced: 6.1.0.156 |
Examples
There are currently no examples for this tag.
See also
- Application
- Core CFML Language
- Scopes
- Session
- Create an Application.cfc
- Set a Mapping (regular, component and custom tag mapping)
- Update current Application Context
- Adding Caches via Application.cfc
- Define a mapping
- Mail Listeners
- Query Listeners
- ApplicationStop()
- GetApplicationMetadata()
- GetApplicationSettings()
- SessionInvalidate()
- SessionRotate()
- System Properties and Environment Variables
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)