September 7, 2006

Server settings with Java

Here are a couple of ways which you can determine the name of the JRun instance you are running as well as the server name of the Application server. Here at Daemon we use these quite a bit in our more complex project environments.

<!--- get the machine (server) name --->
<cfset variables.serverName = createObject("java", "").localhost.getHostName() />

<!--- get the JRun instance name --->
<cfset variables.instanceName = createObject("java", "jrunx.kernel.JRun").getServerName() />

    Server: #variables.serverName#
    <br /> 
    JRun Instance: #variables.instanceName#

Nice :)

© Michael Sharman 2017