Global object that stores information about the server environment.
| $server | Global object that stores information about the server environment. |
| Properties | |
| dataSources | A structure of DS information |
| isThread | true if this is an independent thread with no access to session or servlet |
| threadFunctionSource | the source of the function that the current subthread is executing, or null if this is not a subthread |
| instanceId | an identifier for this server instance |
| purpose | A short name that describes the purpose of this instance. |
| response | A reference to servlet response object |
| request | A reference the servlet request object. |
| requestScriptName | The name of the originally requested script. |
| serverUrl | The the server name and protocol of the request |
| remoteAddr | The IP address of the requestor |
| requestServerUrl | DEPRECATED see $server.serverUrl |
| requestDir | MynaPath representing the directory of the originally requested script. |
| requestUrl | URL Path representing the directory of the originally requested script. |
| resolveUrl | takes a url path relative to the request directory and returns an absolute URL, including the server part. |
| rootDir | MynaPath representing the Myna root directory. |
| rootUrl | URL Path representing the Myna root directory. |
| currentDir | MynaPath representing the directory of the currently executing script. |
| currentUrl | URL Path representing the directory of the currently executing script |
| globalScope | A reference to the Top Level Javascript scope in the current script |
| servlet | Reference to the servlet object. |
| version | String representing the running version of Myna. |
| scriptName | The name of the currently running script. |
| tempDir | MynaPath of the JVM temp directory |
| hostName | the hostname of the server running myna |
| ipAdresses | An array of the non-loopback ipv4 IP addresses on this machine |
| osName | String representing the host operating system type. |
| osArch | String representing the host cpu architecture. |
| osVersion | String representing the host operating system version. |
| properties | The general properties set in the gerneal Settings section of the Administrator |
| memCurrent | The current heap size in bytes. |
| memMax | The maximum heap size |
| memFree | The current number of free bytes on the heap. |
| memAvailable | The number of free bytes on the heap + unallocaed heap space. |
| memUsed | The number of used bytes on the heap |
| get | retrieves a server variable |
| set | Sets a variable that is available across all requests. |
the source of the function that the current subthread is executing, or null if this is not a subthread
A short name that describes the purpose of this instance. Set in General Settings of Myna Administrator
The the server name and protocol of the request
http://localhost:8080
If Myna is behind a proxy you will want to make sure that the X-Forwarded-Host and optionally X-Forwarded-Proto request headers are set by the proxy so that a valid result is generated
The IP address of the requestor
123.345.678.910
This is normally the IP address of the request. If the X-Forwarded-For header is set, then that IP address is returned instead
DEPRECATED see $server.serverUrl
MynaPath representing the directory of the originally requested script.
file:/usr/share/tomcat/webapps/myna/myna/administrator/
URL Path representing the directory of the originally requested script.
/myna/myna/administrator/
takes a url path relative to the request directory and returns an absolute URL, including the server part.
| path | a url path relative to the request directory |
//return full URL to this page
var linkUrl = $server.resolveUrl($server.requestScriptName);
MynaPath representing the directory of the currently executing script.
file:/usr/share/tomcat/webapps/myna/myna/administrator/views/
URL Path representing the directory of the currently executing script
/<context root>/myna/administrator/views/
A reference to the Top Level Javascript scope in the current script
A reference to the Top Level Javascript scope in the current script. This analogous to “window” in a browser environment.
The general properties set in the gerneal Settings section of the Administrator
var purpose = $server.properties.instance_purpose
The current heap size in bytes.
for the maximum memory that could be allocated
$server.memMax, $server.memAvailable, $server.memFree, $server.memUsed, Myna.freeMemory()
The maximum heap size
$server.memCurrent, $server.memAvailable, $server.memFree, $server.memUsed, Myna.freeMemory()
The current number of free bytes on the heap.
For the total memory available for new objects, see memAvailable
$server.memMax, $server.memCurrent, $server.memAvailable, $server.memUsed, Myna.freeMemory()
The number of free bytes on the heap + unallocaed heap space.
$server.memMax, $server.memCurrent, $server.memFree, $server.memUsed, Myna.freeMemory()
The number of used bytes on the heap
$server.memMax, $server.memCurrent, $server.memAvailable, $server.memFree, $server.memUsed, Myna.freeMemory()
Returns the Java Properties object loaded from /WEB-INF/classes/general.properties
Myna.getGeneralProperties=function Myna_getGeneralProperties()
attempts to free the specified amount of memory within the timeout, returning true if successful.
Myna.freeMemory=function Myna_freeMemory( size, timeout )