CFLib.org – Common Function Library Project

getApplicationName()

Last updated September 16, 2005

author

Steven Maglio

Version: 1 | Requires: CF6 | Library: UtilityLib

Description:
Returns the value of the name attribute. This attribute is set within the cfapplication tag. Usually this application name can be garnered from the application structure (application.applicationname). However, sometimes this value is missing (usually due to a structClear( application ) call).

Return Values:
Returns a string.

Example:

application name =
<cfoutput>#getApplicationName()#</cfoutput>

Parameters:

No arguments.

Full UDF Source:

/**
 * returns the name of the cfapplication.
 * 
 * @return Returns a string. 
 * @author Steven Maglio (smaglio@graddiv.ucsb.edu) 
 * @version 1, September 16, 2005 
 */
function getApplicationName() {
	var name = "";
	var appScopeTracker = createObject("java", "coldfusion.runtime.ApplicationScopeTracker");
	var keys = appScopeTracker.getApplicationKeys();
	var app = 0;
	var appName = 0;
	
	while(keys.hasNext()) {
		appName = keys.next();
		app = appScopeTracker.getApplicationScope(appName);
		if(app.equals( application ) ) return app.getName();
	}
	return "";
}
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson