Helma logo
helma.org » Home > Stories > getProperty()

getProperty()

Retrieves an application's property (a run-time global property).

Syntax
getProperty(String)
getProperty(String, String)

The function returns the value of the property which name equals the first string argument. Such application properties are stored in either the app.properties or server.properties file.
A second optional string argument is used as return value in case no matching entry is found in the property files.

If a property exists in both of the files, app.properties has higher priority than server.properties. This way, server.properties defines properties for all applications which app.properties can refine for a particular application.

app.properties is located in the top directory of a Helma application, server.properties is located in the Helma installation directory.

There is a complete list of Helma's property files.

Example
var smtp = getProperty("smtp");
res.write(smtp);
mail.helma.org
var value = getProperty("nonExistingKey", "defaultValue");
res.write(value);
defaultValue


... comment


Page last modified on 2004-04-02 00:56 by rist