Lucee Tag Reference

<cfapplication>

Defines scoping for an application, enables or disables storing client variables, and specifies a client variable storage mechanism. By default, client variables are disabled. Also, enables session variables and sets timeouts for session and application variables. Session and application variables are stored in memory.

Body

This tag can't have a body.

Example

<cfapplication
[action=create|update]
[applicationtimeout=timespan]
[authcookie=struct]
[blockedextforfileupload=string]
[bufferoutput=boolean]
[cachedafter=timespan]
[cachefile=string]
[cachefunction=string]
[cachehttp=string]
[cacheinclude=string]
[cacheobject=string]
[cachequery=string]
[cacheresource=string]
[caches=struct]
[cachetemplate=string]
[cachewebservice=string]
[cgireadonly=boolean]
[clientcluster=boolean]
[clientmanagement=boolean]
[clientstorage=string]
[clienttimeout=timespan]
[componentpaths=any]
[compression=boolean]
[customtagpaths=any]
[datasource=object]
[datasources=struct]
[defaultdatasource=object]
[ftp=struct]
[functionpaths=any]
[invokeimplicitaccessor=boolean]
[javasettings=struct]
[locale=locale]
[localmode=string]
[loginstorage=cookie|session]
[logs=struct]
[maillistener=any]
[mails=array]
[mappings=struct]
[name=string]
[nullsupport=boolean]
[onmissingtemplate=object]
[ormenabled=boolean]
[ormsettings=struct]
[proxy=struct]
[psq=boolean]
[regex=any]
[requesttimeout=timespan]
[resourcecharset=String]
[s3=struct]
[sameformfieldsasarray=boolean]
[sameurlfieldsasarray=boolean]
[scopecascading=String]
[scriptprotect=string]
[searchimplicitscopes=boolean]
[searchresults=boolean]
[securejson=boolean]
[securejsonprefix=string]
[serializationsettings=struct]
[sessioncluster=boolean]
[sessioncookie=struct]
[sessionmanagement=boolean]
[sessionstorage=string]
[sessiontimeout=timespan]
[sessiontype=cfml|j2ee]
[setclientcookies=boolean]
[setdomaincookies=boolean]
[suppressremotecomponentcontent=boolean]
[tag=struct]
[timezone=timezone]
[triggerdatamember=boolean]
[typechecking=boolean]
[variableusage=string]
[webcharset=String]
[wstype=string]
[xmlfeatures=struct] ... >
This tag is also supported within cfscript
<cfscript>
application
[action=create|update]
[applicationtimeout=timespan]
[authcookie=struct]
[blockedextforfileupload=string]
[bufferoutput=boolean]
[cachedafter=timespan]
[cachefile=string]
[cachefunction=string]
[cachehttp=string]
[cacheinclude=string]
[cacheobject=string]
[cachequery=string]
[cacheresource=string]
[caches=struct]
[cachetemplate=string]
[cachewebservice=string]
[cgireadonly=boolean]
[clientcluster=boolean]
[clientmanagement=boolean]
[clientstorage=string]
[clienttimeout=timespan]
[componentpaths=any]
[compression=boolean]
[customtagpaths=any]
[datasource=object]
[datasources=struct]
[defaultdatasource=object]
[ftp=struct]
[functionpaths=any]
[invokeimplicitaccessor=boolean]
[javasettings=struct]
[locale=locale]
[localmode=string]
[loginstorage=cookie|session]
[logs=struct]
[maillistener=any]
[mails=array]
[mappings=struct]
[name=string]
[nullsupport=boolean]
[onmissingtemplate=object]
[ormenabled=boolean]
[ormsettings=struct]
[proxy=struct]
[psq=boolean]
[regex=any]
[requesttimeout=timespan]
[resourcecharset=String]
[s3=struct]
[sameformfieldsasarray=boolean]
[sameurlfieldsasarray=boolean]
[scopecascading=String]
[scriptprotect=string]
[searchimplicitscopes=boolean]
[searchresults=boolean]
[securejson=boolean]
[securejsonprefix=string]
[serializationsettings=struct]
[sessioncluster=boolean]
[sessioncookie=struct]
[sessionmanagement=boolean]
[sessionstorage=string]
[sessiontimeout=timespan]
[sessiontype=cfml|j2ee]
[setclientcookies=boolean]
[setdomaincookies=boolean]
[suppressremotecomponentcontent=boolean]
[tag=struct]
[timezone=timezone]
[triggerdatamember=boolean]
[typechecking=boolean]
[variableusage=string]
[webcharset=String]
[wstype=string]
[xmlfeatures=struct]...;
</cfscript>

Attributes

This tag has a fixed definition of attributes (see below). In addition it allowes to use any additional attribute
Name Type Required Default Value Description
action string No create action for the data set:
- create (default): creates a new application context and overwrite the existing
- update: update the existing application context when there is already one, otherwise a new one is created 
applicationtimeout timespan No Enter the CreateTimeSpan function and values in days, hours, minutes, and seconds, separated
by commas, to specify the lifespan of application variables. The default value is specified in
the Variables page of the Lucee Administrator. 
authcookie struct No cfauthorization cookie behaviour 
blockedextforfileupload string No A comma separated list of file extensions that will be blocked for File Upload operation 
bufferoutput boolean No 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. 
cachedafter timespan No set the timespan for the attribute "cachedAfter" from tag "query". 
cachefile string No name of the cache used to store data from file operations 
Introduced: 5.0.0.0
cachefunction string No name of the cache used for function caching in this context 
cachehttp string No name of the cache used to store data from a http tag 
Introduced: 5.0.0.0
cacheinclude string No name of the cache used to store data from an include 
cacheobject string No name of the cache used for object caching in this context 
cachequery string No name of the cache used for query caching in this context 
cacheresource string No name of the cache used to store data from ram resource in this context 
caches struct No A structure that contains cache definitions. 
cachetemplate string No name of the cache used for template caching in this context 
cachewebservice string No name of the cache used to store data from webservice calls 
Introduced: 5.0.0.0
cgireadonly boolean No true if set to true, the CGI Scope is readonly. 
clientcluster boolean No 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". 
clientmanagement boolean No Yes or No. Enables client variables. Default is No. 
clientstorage string No Specifies how Lucee stores client variables:
  • memory: the session is only kept in memory
  • cookie: the session is stored in the client cookie
  • file (default): the session is stored in a local file
  • "datasource-name"|"cache-name": when you select a name of an available datasource or cache, the client scope will be stored in there 
  • clienttimeout timespan No 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. 
    componentpaths any No Contains component paths. 
    compression boolean No Enable compression (GZip) for the Lucee Response stream for text-based responses when supported by the client (Web Browser). 
    customtagpaths any No Contains custom tag paths. 
    datasource any No alias for default datasource 
    datasources struct No A structure that contains datasources definitions. 
    defaultdatasource any No the default datasource for this environment 
    ftp struct No A struct that defines default ftp settings, this settings can be overwritten as part of the ftp file path, the following keys are supported:
  • username: username to access the ftp server
  • password: password to access the ftp server
  • port: port of the FTP server
  • host: hostname of the FTP server (lucee.org) 
  • functionpaths any No Array or String list of paths where you have your functions. 
    invokeimplicitaccessor boolean No alias for triggerDataMember 
    javasettings struct No a struct to define dynamically java libraries
    the following keys are supported
    - loadPaths - an array or a comma separated string list of jars or class directories
    - bundles - an array or a comma separated string list of OSGI jars
    - reloadOnChange - reload updated jars without a restart necessary
    - watchInterval - interval it checks for changes with the jar files
    - watchExtensions - extension of the files read 
    locale locale No 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. 
    localmode string No 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).
  • modern: the local scope is always invoked
  • classic (CFML standard): the local scope is only invoked when the key already exists in it 
  • loginstorage string No storage for the login data:
    - cookie: store login information in the Cookie scope
    - session: store login information in the Session scope 
    logs struct No A structure that contains log definitions. 
    maillistener any No  
    mails array No mail servers. 
    mappings struct No 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. 
    name string No The name of your application. This name can be up to 64 characters long.
    Required for application and session variables, optional for client variables 
    nullsupport boolean No enable or disable full null support 
    onmissingtemplate any No closure/udf executed when the requested template does not exist 
    ormenabled boolean No Specifies whether ORM should be enabled for the current application context.The default is false. 
    ormsettings struct No A struct that defines all the ORM settings, the following keys are supported:
  • autogenmap(default:true): Specifies whether Lucee should automatically generate mapping for the persistent CFCs. If autogenmap=false, mapping should be provided in the form of "{cfc-name}.cfc.hbm.xml" files.
  • automanageSession(default:true; not supported yet): Lets you specify if Lucee must manage Hibernate session automatically. If enabled: Lucee manages the session completely. That is, it decides when to flush the session, when to clear the session, and when to close the session. If disabled: The application is responsible for managing flushing, clearing, or closing of the session. The only exception is (in the case of transaction), when the transaction commits, the application flushes the session. Lucee closes the ORM session at the end of request irrespective of this flag being enabled or disabled.
  • cacheconfig: Specifies the location of the configuration file that should be used by the secondary cache provider.This setting is used only when secondarycacheenabled=true.
  • cacheprovider: Specifies the cache provider that should be used by ORM as secondary cache.
  • catalog: Specifies the default Catalog that should be used by ORM.
  • cfclocation: Specifies the directory (or array of directories) that should be used by Lucee to search for persistent CFCs to generate the mapping. If cfclocation is set, Lucee looks at only the paths specified in it. If it is not set, Lucee looks at the application directory, its sub-directories, and its mapped directories to search for persistent CFCs.
  • datasource: Specifies the data source that should be used by ORM. If it is not specified here, then the data source specified for the application is picked up.
  • dbcreate(default:none): Hibernate can automatically create the tables for your application in the database. dbCreate takes the following values:
  • - update: Setting this value creates the table if it does not exist or update the table if it exists.
  • - dropcreate: Setting this value drops the table if it exists and then creates it.
  • - none: Setting this value does not change anything in the database schema.
  • dialect: Specifies the dialect.Lucee supports the following dialects: [Cache 2007.1, Cache71, Cache 2007.1, DB2, DB2/390, DB2/400, DB2390, DB2400, DB2AS400, DB2OS390, DataDirectOracle9, Derby, Firebird, FrontBase, H2, H2DB, HSQL, HSQLDB, Informix, Ingres, Interbase, JDataStore, MSSQL, Mckoi, MckoiSQL, MicrosoftSQLServer, Mimer, MimerSQL, MySQL, MySQL/InnoDB, MySQL/MyISAM, MySQL5, MySQL5/InnoDB, MySQL5InnoDB, MySQLInnoDB, MySQLMyISAM, MySQLwithInnoDB, MySQLwithMyISAM, Oracle, Oracle10g, Oracle8i, Oracle9, Oracle9i, Pointbase, PostgreSQL, PostgresPlus, Progress, SAPDB, SQLServer, Sybase, Sybase11, SybaseASE15, SybaseAnywhere, com.ddtek.jdbc.db2.DB2Driver, com.microsoft.jdbc.sqlserver.SQLServerDriver, oracle.jdbc.driver.OracleDriver, org.firebirdsql.jdbc.FBDriver, org.gjt.mm.mysql.Driver, org.h2.Driver, org.hsqldb.jdbcDriver, org.postgresql.Driver]
  • eventHandling(default:false): Specifies whether ORM Event callbacks should be given.
  • flushatrequestend(default:true): Specifies whether ormflush should be called automatically at request end. If flushatrequestend is false, ormflush is not called automatically at request end.
  • logSQL(default:false): Specifies whether the SQL queries that are executed by ORM will be logged. If LogSQL=true, the SQL queries are logged to the console.
  • ormconfig: The Hibernate configuration file. This file contains various configuration parameters like, dialect, cache settings, and mapping files that are required for the application. For more details, see www.hibernate.org/hib_docs/reference/en/html/session-configuration.html. The settings defined in the ormsettings override the settings defined in the Hibernate Configuration XML file.The connection information in the Hibernate Configuration XML file is however ignored because Lucee uses its own connection pool. You will need to use this only when you need to use a hibernate setting that is not available using ormsetting.
  • savemapping(default:false): Specifies whether the generated Hibernate mapping file has to be saved to disc. If you set the value to true, the Hibernate mapping XML file is saved with the filename "CFC name".hbm.xml in the same directory as the CFC. If any value of savemapping is specified in CFC, it will override the value specified in the ormsetting.
  • schema: Specifies the default Schema that should be used by ORM.
  • secondarycacheenabled(default:false): Specifies whether secondary caching should be enabled
  • skipCFCWithError(default:false;not implemented yet): Lets you specify if Lucee must skip the CFCs that have errors. If set to true, Lucee ignores the CFCs that have errors.
  • sqlscript: Path to the SQL script file that gets executed after ORM is initialized. This applies if dbcreate is set to dropcreate. This must be the absolute file path or the path relative to the application.The SQL script file lets you populate the tables before the application is accessed.
  • useDBForMapping(default:true): Specifies whether the database has to be inspected to identify the missing information required to generate the Hibernate mapping. The database is inspected to get the column data type, primary key and foreign key information. 
  • proxy struct No general proxy that should be used for all connections with the following format:
    {server:"localhost", port:12345, username:"susi", password: "sorglos"} 
    psq boolean No preserve single quote in injected variables into cfquery. 
    regex any No allow to define a struct containg the configuration for regular expressions,
    ATM only the key "engine" is supported, with the possible values [java,perl] to choose the regex dialect. 
    requesttimeout timespan No 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. 
    resourcecharset String No character set used for reading from/writing to various resources 
    s3 struct No A struct that defines default S3 settings, this settings can be overwritten as part of the S3 file path, the following keys are supported:
  • accessKeyId: S3 access key id
  • awsSecretKey: AWS (Amazon Web Service) Secret Key
  • defaultLocation(default:us): region for the bucket, possible values are [eu,us,us-west]
  • host(default:"s3.amazonaws.com"): hostname of the service 
  • sameformfieldsasarray boolean No Default False
    When true, form fields with the same name will be combined into an array.
    This only works via Application.cfc 
    sameurlfieldsasarray boolean No Default False
    When true, url fields/parameters with the same name will be combined into an array.
    This only works via Application.cfc 
    scopecascading String No 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:
  • strict: scans only the variables scope
  • small: scans the scopes variables,url,form
  • standard: scans the scopes variables,cgi,url,form,cookie 
  • scriptprotect string No Specifies whether to protect variables from cross-site scripting attacks 
    searchimplicitscopes boolean No 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 No 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. 
    securejson boolean No 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. 
    securejsonprefix string No 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. 
    serializationsettings struct No  
    sessioncluster boolean No 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". 
    sessioncookie struct No session cookie behaviour 
    sessionmanagement boolean No Yes or No. Yes enables session variables. Default is No. 
    sessionstorage string No Specifies how Lucee stores session variables:
  • memory (default): the session is only kept in memory
  • cookie: the session is stored in the client cookie
  • file: the session is stored in a local file
  • "datasource-name"|"cache-name": when you select a name of an available datasource or cache, the session scope will be stored in there 
  • sessiontimeout timespan No 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. 
    sessiontype string No Lucee provide 2 kind of sessions:
  • cfml: session handled by Lucee
  • j2ee: session handled by the Servlet Engine used
    Default value is defined in the Lucee Web Administrator. "j2ee" can not use a session storage. 
  • setclientcookies boolean No 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. 
    setdomaincookies boolean No 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. 
    suppressremotecomponentcontent boolean No Suppress content written to response stream when a Component is invoked remotely. Only works if the content was not flushed before. 
    tag struct No tags/attributes default value in the following structure:
    #{location:{addtoken=false}}# 
    timezone timezone No change the timezone definition for the current application context. 
    triggerdatamember boolean No 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". 
    typechecking boolean No true If disabled, Lucee ignores type definitions with function arguments and return values 
    variableusage string No how to handle variable usage within cfquery, possible values are ignore,warn,error 
    webcharset String No character set used for output streams, form-, url-, and cgi scope variables and reading/writing the header 
    wstype string No webservice type used, this can be one of the following values
  • Axis1 (default): The Apache Axis 1 implementation is used
  • CXF: The CXF implementation is used 
  • xmlfeatures struct No Allows to set XML Features to prevent XXE attacks

    - disallowDoctypeDecl (true / false)
    - externalGeneralEntities (true/false)
    - secure (true/false)