public final class PropertyReader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_CONF_PROPERTYFILE |
static java.lang.String |
DEFAULT_PROPERTYFILE
Path to the default property file.
|
static java.lang.String |
PARAM_PROPERTYFILE
The servlet context parameter (from web.xml) that defines where the
config file is to be found.
|
static java.lang.String |
PARAM_PROPERTYFILE_CASCADEPREFIX
The prefix when you are cascading properties.
|
Modifier and Type | Method and Description |
---|---|
static void |
expandVars(java.util.Properties properties)
You define a property variable by using the prefix "var.x" as a
property.
|
static java.util.Properties |
getDefaultProperties()
Returns the default property set as a Properties object.
|
static java.util.Properties |
loadWebAppProps(ServletContext context)
Loads the webapp properties based on servlet context information,
or (if absent) based on teh Java System Property PARAM_PROPERTYFILE .
|
public static final java.lang.String PARAM_PROPERTYFILE
public static final java.lang.String PARAM_PROPERTYFILE_CASCADEPREFIX
public static final java.lang.String DEFAULT_PROPERTYFILE
public static final java.lang.String DEFAULT_CONF_PROPERTYFILE
public static java.util.Properties loadWebAppProps(ServletContext context)
You can define additional property files and merge them into the default properties file in a similar process to how you define cascading style sheets; hence we call this cascading property files. This way you can overwrite the default values and only specify the properties you need to change in a multiple wiki environment.
You define a cascade in the context mapping of your servlet container.
jspwiki.properties.cascade.1 jspwiki.properties.cascade.2 jspwiki.properties.cascade.3and so on. You have to number your cascade in a descending way starting with "1". This means you cannot leave out numbers in your cascade. This method is based on an idea by Olaf Kaus, see [JSPWiki:MultipleWikis].
context
- A Servlet Context which is used to find the propertiespublic static final java.util.Properties getDefaultProperties()
public static void expandVars(java.util.Properties properties)
var.basedir = /p/mywiki; jspwiki.fileSystemProvider.pageDir = $basedir/www/ jspwiki.basicAttachmentProvider.storageDir = $basedir/www/ jspwiki.workDir = $basedir/wrk/
properties
- - properties to expand;stSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.