New stuff in the latest releases - Part II

December 17, 2007 · By Gert Franz · No Comments

Since we can not stop we have added further things to Railo in the patch Railo 2.0.0.026:

Railo administrator constants
Sometimes it is quite useful to use constants in applications like several paths etc. In Railo you can define these constants in the Railo XML. In one of the future releases these constants will be editable in the Railo administrators. So you can define things like follows:
<railo-configuration ...>
<constants>
<constant name="log-file-dir" value="/storage/logfiles/myWeb" />
</constants>
</railo-configuration>

Then in the mappings and other settings you could use these predefined constants in order to centralize your definitions.
<application application-log="{log-file-dir}/application.log" application-log-level="error" exception-log="{log-file-dir}/exception.log" exception-log-level="error" />
You can even use these constants in your code by applying the function ExpandPath():
<cfset sMyPath = ExpandPath("{log-file-dir}/myfile.log")>
In this case sMyPath contains the value "/storage/logfiles/myWeb/myfile.log". It can therefore be quite useful since you do not have to change a line of code (not even configuration files) in you application. Just use the constants defined in the administrator.

To be continued...

Tags: CFML · Features · Railo 2.0

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment

Leave this field empty: