<cfcomponent>

Creates and defines a component object; encloses functionality that you build in CFML and enclose within cffunction tags. This tag contains one or more cffunction tags that define methods. Code within the body of this tag, other than cffunction tags, is executed when the component is instantiated.

Usage

<cfcomponent
    [alias=string]
    [bindingname=string]
    [hint=string]
    [wsdlfile=string]
    [mappedsuperclass=boolean]
    [style=string]
    [output=boolean]
    [serviceaddress=string]
    [serviceportname=string]
    [displayname=string]
    [synchronized=boolean]
    [extends=string]
    [persistent=boolean]
    [porttypename=string]
    [namespace=string]
><!--- body ---></cfcomponent>

This tag must have a body.

This tag is also supported within cfscript

Attributes

Attribute Description
alias
(string, optional)
bindingname
(string, optional)

Specifies the name of the binding element in the WSDL. This attribute applies only when style="document".

hint
(string, optional)

Text that displays when you use introspection to show information about the CFC. The hint attribute value appears below the component name heading. Use this attribute to describe the purpose of the component.

wsdlfile
(string, optional)

A properly formatted WSDL file to be used instead of WSDL generated by Lucee. This attribute applies only when style="document".

mappedsuperclass
(boolean, optional)
style
(string, optional)

Specifies whether a CFC used for web services uses RPC-encoded style or document-literal style

output
(boolean, optional)
  • true: permits component method output - false: suppresses component method output
serviceaddress
(string, optional)

Specifies the SOAP URL of the web service. If you don't specify this attribute, Lucee uses the URL of the CFC in the WSDL service description. Use this attribute to specify the protocol, for example, by specifying a URL that starts with https://. This attribute applies only for web services.

serviceportname
(string, optional)

Specifies the name of the port element in the WSDL. This attribute applies only when style="document".

displayname
(string, optional)

A string to be displayed when using introspection to show information about the CFC. The information appears on the heading, following the component name. If the style attribute is set to document, the displayname attribute is used as the name of the service element in the WSDL.

synchronized
(boolean, optional)

If set to true all calls to an instance of a component are synchronized. This setting allows a method to be executed only by one single thread at a time.

extends
(string, optional)

Name of parent component from which to inherit methods and properties.

persistent
(boolean, optional)

Specifies CFC is persistent or not

porttypename
(string, optional)

Specifies the name of the porttype element in the WSDL. This attribute applies only when style="document".

namespace
(string, optional)

Specifies the namespace used in the WSDL when using the CFC as a document-literal style web service. If you don't specify this attribute, Lucee derives the namespace from the CFC class name. This attribute applies only when style="document".

Examples

There are currently no examples for this tag.