Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

ColdFusion Markup Language

From Wikipedia, the free encyclopedia
Scripting language for web development
"CFML" redirects here. For other uses, seeCFML (disambiguation).
Cold Fusion Markup Language (CFML)
Paradigmimperative,object-oriented
Designed byJeremy Allaire,Joseph J. Allaire
DeveloperAdobe Systems (ColdFusion), Lucee Association (Lucee), New Atlanta and aw2.0 (openBD), The Railo Company (Railo)
First appeared1995; 31 years ago (1995)
Stable release
2023 Release / 2023; 3 years ago (2023)
Implementation languageJava
OSCross-platform
LicenseDepends on the implementation.Proprietary,LGPL, andGPL-licensed engines are all available.
Filename extensions.cfm, .cfc
Websitewww.adobe.com/products/coldfusion
Majorimplementations
Adobe ColdFusion,Lucee,Railo, BlueDragon, Open BlueDragon
Influenced
Lucee

ColdFusion Markup Language, more commonly known asCFML, is ascripting language for web development that runs on theJava virtual machine (JVM), the.NET framework, andGoogle App Engine. Several commercial andfree and open-source software implementations of CFML engines are available, includingAdobe ColdFusion,Lucee, New Atlanta BlueDragon (Java and .NET versions),Railo, Open BlueDragon, andother CFML server engines.

Synopsis

[edit]

In its simplest form, like many other web scripting languages, CFML augments standardHTML files withdatabase commands, conditionaloperators, high-level formattingfunctions, and other elements to produceweb applications.[1][2] CFML also includes many other constructs including ColdFusion Components (CFCs), CFML's version ofobjects, that allow separating business logic from presentation.

CFML can be written using either tags orCFScript, which resemblesJavaScript (ECMAScript).

The pages in a CFMLapplication include theserver-side CFML tags and functions in addition to HTML tags. Modern CFML applications also tend to have CFCs that are accessed by the CFML pages for executing business logic. When aweb browser requests a page in a ColdFusion application, it is automatically pre-processed by the ColdFusionapplication server.[3]

CFML can also be used to generate other languages, aside from HTML, such asXML,JavaScript,CSS, and so on.

Despite the name, CFML isnot a markup language. It is also notSGML, since certain core CFML features prevent it from complying.

The CFML engine is configured in such a way that certain file extensions on the server (.cfm, .cfc) are handed off to the CFML engine for processing. In the case of the Java-based engines this is accomplished viaJava servlets. The CFML engine only processes CFML tags and functions; it returns text outside of CFML tags and functions to theweb server unchanged.[4]

History

[edit]

Named Cold Fusion at the outset, the software was created in 1995 by theAllaire Corporation, originally located inMinnesota. It later moved to Cambridge, Massachusetts and then finally to Newton, Massachusetts before being acquired byMacromedia in 2001. Allaire Cold Fusion thus became Macromedia Cold Fusion. At the release of version 4, the space in the name was removed to become ColdFusion. Adobe acquired Macromedia in 2005. As of 2023[update], it is still actively developing ColdFusion.

In 1998 Alan Williamson and his Scottish company, "n-ary", began creating a templating engine for Java to simplify common programming tasks.[5] Williamson was using curly-brace notation instead of tags, but when he saw an example of CFML and how it was solving similar problems (although not in Java) using a tag syntax, he started developing what would eventually become BlueDragon, which was the first Java implementation of the CFML language. (ColdFusion was written inC andC++ until version 6.0, the first Java-based version, was released in 2002.) New Atlanta licensed BlueDragon around 2001 and made it available as a commercial product, eventually creating a.NET implementation of CFML. Open BlueDragon is a fork of the commercial BlueDragon product and was first released in 2008.

The Railo CFML engine began as a student project in 2002 and was first launched as a commercial project in 2005.[6] Railo announced they were making the engine open source in 2008, and the first open source version was released in 2009.

On June 18, 2009,Adobe announced at the CFUnited conference that it had formed a CFML Advisory Committee[7] that would be responsible for guiding and reviewing changes to the CFML language. This effort was disbanded in 2010. TheGoogle Group CFML Conventional Wisdom was created as a forum for open, public discussions about language and engine features; its use has dwindled since 2011.[citation needed]

In 2012, the OpenCFML Foundation was launched. Its function is to pushopen-source CFML applications and platforms.

Former Railo lead developer Michael Offner launchedLucee, a fork ofRailo, in London on January 29, 2015. Backed by community supporters and members of the Lucee Association, the goal of the project is to provide the functionality of CFML using fewer resources, giving better performance and to move CFML past its roots and into a modern and dynamic Web programming platform.

In 2025, CFML was still in use. Lucee will hold a CFML conference, CFCAMP, on May 22-23, 2025.[8] The Adobe ColdFusion Summit 2025 is to be held September 21-24, 2025.[9]

Syntax

[edit]

CFML tags have a similar format to HTML tags. They are enclosed inangle brackets (< and >) and generally have zero or more namedattributes, though some tags (e.g. cfset, cfif) contain an expression rather than attributes. Many CFML tags have bodies; that is, they have beginning and end tags with text to be processed between them. For example:

<cfoutput>#value# Bob!</cfoutput>

Other tags, such as cfset and cfftp, never have bodies; all the required information goes between the beginning (<) character and the ending (>) character in the form of tag attributes (name/value pairs), as in the example below. If it is legal for tags not to have a body, it is syntactically acceptable to leave them unclosed as in the first example, though many CFML developers choose to self-close tags as in the second example to (arguably) make the code more legible.

<cfsetvalue="Hello"><cfsetvalue="Hello"/>

Even if the tag can have a body, including a body may not be necessary in some instances because the attributes specify all the required information. In these cases, as with the second example above, the end tag (and hence, the tag body) may be omitted and the tag may be self-closing as in the following example:[10]

<cfexecutename="C:\\winNT\\System32\\netstat.exe"arguments="-e"outputfile="C:\\Temp\\out.txt"timeout="1"/>

Various tags offer the ability to type-check input parameters (e.g. cffunction, cfparam, cfqueryparam) if theprogrammer declares their type specifically. This functionality is used with cfqueryparam tosecure web applications and databases fromhackers and malicious web requests such asSQL injection.

Built-in tags

[edit]

Nearly 100 tags and many more functions make up the heart of the CFML language. The following lists CFML tags by their function or purpose.[11]

Custom tags

[edit]

CFML allows language extensions in the form of custom tags, which are tags created by the developer that are not part of the CFML language itself. Custom tags are regular CFML files which are intended to be invoked as tags, although it is possible to treat atemplate as both a custom tag and a regular template. Custom tags are written in CFML and are typically invoked by prefixing the custom tag's file name withcf_, although there are other ways to invoke custom tags.

If a template is invoked as a custom tag, the attributes used to invoke that tag are available within the tag in anattributes scope and the variables for the calling page are accessible via thecaller scope.

For example, if writing a custom tag to performaddition, taking two attributes and adding them together, the tag would be an addition.cfm file which could look like this:

<cfsetcaller.addition=attributes.first+attributes.second/><cfexitmethod="exitTag"/>

Assuming the tag is in the same directory as the file (or in a pre-defined customtags directory), it can be invoked thus:

<cf_additionfirst="1"second="2">

CFX tags are custom tags which are developed usingJava orC++, and are prefixed with cfx_ just like cf_. Java and C++ tags are added to the CFML runtime environment using the CFML engine's administrator or by editing configuration files.[citation needed]

On some CFML enginesJSP tags can also be included in CFML pages using the <cfimport> tag.[12]

Functions

[edit]

ColdFusion Markup Language includes a set of functions that you use to perform logical and arithmetic operations and manipulate data.

FunctionReferenceCode
Array[13](ArraySort, ArrayAppend, ArrayDeleteAt...)
Conversion[14](URLEncodedFormat, ToString...)
Date and time[15](LsTimeFormat, DateAdd, DateDiff...)
Decision[16](IsDefined, IIF...)
Display and formatting[17](CJustify, NumberFormat...)
Dynamic evaluation[18](DE, Evaluate...)
Extensibility[19](CreateObject, ToScript...)
Image[20](ImageRotate, ImageAddBorder...)
International functions[21](SetLocale, GetTimeZoneInfo...)
List[22](FindOneOf, ListSetAt...)
Mathematical[23](Randomize, Sqr...)
Other functions[24](WriteOutput, GetBaseTemplatePath...)
Query[25](QueryAddColumn, QuerySetCell...)
Security[26](Encrypt, Decrypt...)
String[27](Reverse, HTMLCodeFormat...)
Structure[28](StructKeyExists, StructDelete...)
System[29](GetTickCount, GetTempFile...)
XML[30](XMLParse, GetSOAPResponse...)

ColdFusion Components (CFCs)

[edit]

CFCs provide some (not all) of the typical features and functionality that are provided byobject-oriented (OOP) languages.To create a CFC:

Create a file with a .CFC extension (this distinguishes CFCs from ColdFusion templates, which have a .CFM extension).
Use four tags to create the components, define their functions andarguments, and return a value.
<cfcomponent>
Defines a CFC
<cffunction>
Defines the functions (methods) within a CFC
<cfargument>
Defines the arguments (parameters) that a function accepts
<cfreturn>
Returns a value or result from a function

CFCs are plain CFML. Within a CFC any CFML tag, function, custom tag, other components, etc. may be used.

CFCs can be used in various ways. If a method contained in a CFC simply needs to be invoked, the<cfinvoke> tag will create an instance of the CFC, invoke the desired method, and then destroy the instance of the CFC.<cfinvoke> takes the name of the component (minus the .cfc extension) and the method to execute. To access any returned data, theRETURNVARIABLE attribute provides the name of a variable to contain whatever the function returns.CFCs are created using four tags, saved as .CFC files, and invoked using the<cfinvoke> tag.[31]

In the example below, component temperature.cfc has a method FtoC which converts temperature from Fahrenheit to Celsius. The test.cfm template invokes the method and converts 212 degrees Fahrenheit and outputs the result.

<!--- temperature.cfc ---><cfcomponent><cffunctionname="FtoC"access="public"returntype="numeric"><cfargumentname="fahrenheit"required="yes"type="numeric"/><cfsetanswer=(fahrenheit-32)*100/180/><cfreturnanswer/></cffunction></cfcomponent><!--- test.cfm ---><cfsetfDegrees=212/><cfinvokecomponent="temperature"method="FtoC"returnvariable="result"><cfinvokeargumentname="fahrenheit"value="#fDegrees#"/></cfinvoke><cfoutput>#fDegrees#&deg;F =#result#&deg;C</cfoutput><br/>

CFCs may also be instantiated as objects. Assuming a CFC file called Person.cfc, an instance of this CFC would be instantiated as follows:

<cfsetperson=CreateObject("component","Person")/>

CFCs also form the basis of the ability to createweb services in CFML. A CFC is created in the usual way, and the attribute access="remote" added to any function within the CFC will make that function available to be called as aSOAP-based web service. The CFML engine auto-generates aWSDL and creates all the necessary stubs for the web service to function.

Security updates

[edit]

Adobe releases security patches for ColdFusion as needed, typically in response to identified vulnerabilities. These updates address critical issues such asarbitrary code execution and security feature bypasses. For instance, on December 23, 2024, Adobe released updates for ColdFusion 2023 and 2021 to resolve a critical vulnerability that could lead to arbitrary file system read. To stay informed about the latest security updates, users should regularly check Adobe's official ColdFusion security bulletins. Additionally, subscribing to Adobe's security notification service ensures timely alerts about new patches and vulnerabilities. Implementing these updates promptly is crucial to maintaining the security and integrity of ColdFusion applications.

References

[edit]
  1. ^Adobe ColdFusion 8 – About Internet applications and web application serversArchived 2012-05-13 at theWayback Machine. Livedocs.adobe.com. Retrieved on 2013-09-17.
  2. ^Open BlueDragon Manual. Openbd.org. Retrieved on 2013-09-17.
  3. ^Smith, MichaelWhat is ColdFusion? fusionauthority.com
  4. ^TagsArchived March 24, 2008, at theWayback Machine
  5. ^Open BlueDragon Steering Committee Interview Series – Alan Williamson. alan.blog-city.com
  6. ^About Railo. Getrailo.org. Retrieved on 2013-09-17.
  7. ^http://corfield.org/entry/CFML_Advisory_CommitteeArchived 2009-01-07 at theWayback Machine CFML Advisory Committee – An Architect's View. Corfield.org. Retrieved on 2013-07-21.
  8. ^Spitzer, Zac (April 1, 2025)."CFCAMP 2025, May 22nd & 23rd, Munich, Germany". RetrievedApril 22, 2025.
  9. ^"Adobe ColdFusion Summit 2025". April 22, 2025. RetrievedApril 22, 2025.
  10. ^Tag syntaxArchived May 27, 2008, at theWayback Machine
  11. ^Tags by functionArchived 2008-05-09 at theWayback Machine. (PDF) Retrieved on 2013-09-17.
  12. ^"Using JSP tags and tag libraries".Using JSP tags and tag libraries. Apr 27, 2021.Archived from the original on Feb 15, 2025. RetrievedOct 20, 2025.
  13. ^Array functionsArchived 2008-12-10 at theWayback Machine. Livedocs.adobe.com. Retrieved on 2013-09-17.
  14. ^Conversion functionsArchived 2008-12-08 at theWayback Machine. Livedocs.adobe.com. Retrieved on 2013-09-17.
  15. ^Date and time functionsArchived 2008-12-02 at theWayback Machine. Livedocs.adobe.com. Retrieved on 2013-09-17.
  16. ^Decision functionsArchived 2009-02-01 at theWayback Machine. Livedocs.adobe.com. Retrieved on 2013-09-17.
  17. ^Display and formatting functionsArchived 2008-12-20 at theWayback Machine. Livedocs.adobe.com. Retrieved on 2013-09-17.
  18. ^Dynamic evaluation functionsArchived 2008-12-07 at theWayback Machine. Livedocs.adobe.com. Retrieved on 2013-09-17.
  19. ^ExtensibilityArchived 2009-02-14 at theWayback Machine. Livedocs.adobe.com. Retrieved on 2013-09-17.
  20. ^Image functionsArchived 2009-01-31 at theWayback Machine. Livedocs.adobe.com. Retrieved on 2013-09-17.
  21. ^International functionsArchived 2009-02-08 at theWayback Machine. Livedocs.adobe.com. Retrieved on 2013-09-17.
  22. ^List functionsArchived 2008-12-10 at theWayback Machine. Livedocs.adobe.com. Retrieved on 2013-09-17.
  23. ^Mathematical functionsArchived 2008-12-07 at theWayback Machine. Livedocs.adobe.com. Retrieved on 2013-09-17.
  24. ^Other functionsArchived 2009-01-30 at theWayback Machine. Livedocs.adobe.com. Retrieved on 2013-09-17.
  25. ^Query functionsArchived 2009-02-21 at theWayback Machine. Livedocs.adobe.com. Retrieved on 2013-09-17.
  26. ^Security functionsArchived 2008-12-05 at theWayback Machine. Livedocs.adobe.com. Retrieved on 2013-09-17.
  27. ^String functionsArchived 2009-01-29 at theWayback Machine. Livedocs.adobe.com. Retrieved on 2013-09-17.
  28. ^Structure functionsArchived 2009-02-14 at theWayback Machine. Livedocs.adobe.com. Retrieved on 2013-09-17.
  29. ^System functionsArchived 2009-02-01 at theWayback Machine. Livedocs.adobe.com. Retrieved on 2013-09-17.
  30. ^XML functionsArchived 2009-02-20 at theWayback Machine. Livedocs.adobe.com. Retrieved on 2013-09-17.
  31. ^Forta, BenUsing ColdFusion components. adobe.com

External links

[edit]
CFML programming language
Implementations
Applications
Frameworks
Development Resources
IDEs / Editors
Debugging and monitoring
Retrieved from "https://en.wikipedia.org/w/index.php?title=ColdFusion_Markup_Language&oldid=1324434548"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp