Variable evaluation order

No such variable: No variable Test defined.

The variables are evaluated in the following order:

  1. 'Preset' variables (or constants), as those listed on this page.
  2. 'Context' variables, as those set by plugins and tags.
  3. 'Property' variables, like those set in
  4. 'Page' variables, like those set using the "SET" directive.


WikiVariables are variables that are evaluated when a page is viewed.

The two types of WikiVariables are defined below.

Page Variables#

Starting with JSPWiki 2.2, you can use the "SET" directive to define a variable that exists only in the page.
For example:
  [{SET foo='bar'}]

creates you a variable called "foo", which has the value of "bar". You can access this value anywhere on your page by using the shorthand "[{$foo}]".

Pre-defined Variables#

applicationnameThis is the name of this Wiki. It has been set by the administrator in "".Ldapwiki[{$applicationname}]
baseurlThe base URL address for this wiki[{$baseurl}]
encodingDescribes the character encoding used in this Wiki. An encoding of "UTF-8" means that the Wiki accepts any character, including Chinese, Japanese, etc. Encoding "ISO-8859-1" means that only western languages are supported.UTF-8'[{$encoding}]
inlinedimagesLets you know which image types are able to be inlined*,*, *.png, *.jpg[{$inlinedimages}]
interwikilinksWrites HTML code for supported InterWiki linksWikiWikiWeb -->, JSPWiki -->, Doc -->, TWiki -->, Wikipedia -->, Google -->, RFC -->, MeatballWiki -->, Edit --> Edit.jsp?page=%s[{$interwikilinks}]
jspwikiversionInserts the version number of the JSPWiki engine.2.10.1[{$jspwikiversion}]
loginstatusShows the status of the current logged-in useranonymous[{$loginstatus}]
uptimeInserts the amount of time since this Wiki has been last restarted24d, 13h 13m 8s[{$uptime}]
pagenameInserts the current page name.WikiVariables[{$pagename}]
pageproviderThe current[{$pageprovider}]
pageproviderdescriptionA verbose, HTML description about the currently used page providerReal provider: Cache misses: 442434. Cache hits: 1374788. History cache hits: 17607. History cache misses: 4549[{$pageproviderdescription}]
requestcontextThe current RequestContextview[{$requestcontext}]
totalpagesThe total number of pages available in this Wiki12765[{$totalpages}]
usernameInserts the current user name54.162.164.86[{$username}]
inlinedimagesInlined images on Ldapwiki*,*, *.png, *.jpg[{$inlinedimages}]
pagefiltersInstalled PageFilters[{$pagefilters}]

Inserting JSPWiki properties#

You can also access some of the JSPWiki properties (that have been defined by the site maintainer) by using their property names directly. See SystemInfo for an example. Note that some properties might not be accessible due to security reasons.

You can also obtain some data from the JSPWiki Plugins.

Needs more info on how to set global variables in I cannot find how anywhere..

More Information#

There might be more information for this subject on one of the following:

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-21) was last changed on 15-Feb-2013 11:35 by jim