Skip to main content
Community Manager
Mar 4, 2020 10:11 AM UTC
Question

ColdFusion (2018 release) imports environment vars into the server scope

Thanks to Charlie's blog and Pete's tweet, we have another hidden gem in ColdFusion (2018 release). 

ColdFusion (2018 release) imports environment variables into the server scope.

For instance,

<cfscript>
    writeDump(server.system.environment)
</cfscript>

The snippet above returns a struct that contains environment variables.

ColdFusion (2018 release) also imports Java system properties.

For instance,

<cfscript>
    writeDump(server.system.properties)
</cfscript>

The snippet above returns a struct that contains Java system properties.

Pete has also documented these scopes in the cfdocs site.

This topic is closed to new replies. Start a new post to keep the conversation going.