Reputation: 851
this is my code .
<cfhttp method="head" url="http://www.sisystems.com" result="myResult">
<cfoutput>
#myResult.Statuscode#
</cfoutput>
This code gives the status code for this url . i need to know in which coldfusion server it hits.
Upvotes: 2
Views: 1559
Reputation: 13548
For your question in the comments of Sunny's answer - You can use the following Java methods to gather information about the particular server that ColdFusion is running on:
<cfset cfHostName = createObject("java", "java.net.InetAddress").localhost.getHostName() />
<cfset cfCanonName = createObject("java", "java.net.InetAddress").localhost.getCanonicalHostName() />
<cfset cfHostAddress = createObject("java", "java.net.InetAddress").localhost.getHostAddress() />
And prior to ColdFusion 10, when ColdFusion is running on JRun you can also use the following:
<cfset cfInstance = createObject("java", "jrunx.kernel.JRun").getServerName() />
Upvotes: 2
Reputation: 20623
You can get the coldfusion server instance name using coldfusion adminapi as below
runtime = createObject("component", "CFIDE.adminapi.runtime");
instanceName = runtime.getInstanceName();
Thanks
Upvotes: 5