Variable evaluation order


liji
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 jspwiki.properties.
  4. 'Page' variables, like those set using the "SET" directive.

Overview#

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#

VariableDescriptionValueCode
applicationnameThis is the name of this Wiki. It has been set by the administrator in "jspwiki.properties".Ldapwiki[{$applicationname}]
baseurlThe base URL address for this wikihttp://ldapwiki.com/[{$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 inlinedhttp://willeke.com/Family/Photos/*, http://willeke.com/ASSETS/IMAGES/*, *.png, *.jpg[{$inlinedimages}]
interwikilinksWrites HTML code for supported InterWiki linksWikiWikiWeb --> http://c2.com/cgi/wiki?%s, JSPWiki --> http://jspwiki-wiki.apache.org/Wiki.jsp?page=%s, Doc --> http://jspwiki-wiki.apache.org/Wiki.jsp?page=%s, TWiki --> http://twiki.org/cgi-bin/view/TWiki/%s, Wikipedia --> http://www.wikipedia.com/wiki/%s, Google --> http://www.google.com/search?q=%s, RFC --> https://tools.ietf.org/html/rfc%s, MeatballWiki --> http://usemod.com/cgi-bin/mb.pl?%s, 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 restarted21d, 23h 34m 1s[{$uptime}]
pagenameInserts the current page name.WikiVariables[{$pagename}]
pageproviderThe current PageProviderorg.apache.wiki.providers.CachingProvider[{$pageprovider}]
pageproviderdescriptionA verbose, HTML description about the currently used page providerReal provider: org.apache.wiki.providers.VersioningFileProvider. Cache misses: 273777. Cache hits: 1203326. History cache hits: 16159. History cache misses: 2799[{$pageproviderdescription}]
requestcontextThe current RequestContextview[{$requestcontext}]
totalpagesThe total number of pages available in this Wiki12579[{$totalpages}]
usernameInserts the current user name54.81.197.127[{$username}]
inlinedimagesInlined images on Ldapwikihttp://willeke.com/Family/Photos/*, http://willeke.com/ASSETS/IMAGES/*, *.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 jspwiki.properties. 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