This page last changed on Dec 02, 2008 by smaddox.
On this page:
Error formatting macro: toc: java.lang.NullPointerException
Purpose of this Module Type
Servlet Context Parameter plugin modules allow you to set parameters in the Java Servlet context shared by your plugin's servlets, filters, and listeners.
Configuration
The root element for the Servlet Context Parameter plugin module is servlet-context-param. It allows the following attributes and child elements for configuration:
Attributes
Name |
Required |
Description |
Default |
class |
|
The class which implements this plugin module. The class you need to provide depends on the module type. For example, Confluence theme, layout and colour-scheme modules can use classes already provided in Confluence. So you can write a theme-plugin without any Java code. But for macro and listener modules you need to write your own implementing class and include it in your plugin. |
|
disabled |
|
Indicate whether the plugin module should be disabled by default (value='true') or enabled by default (value='false'). |
false |
i18n-name-key |
|
The localisation key for the human-readable name of the plugin module. |
|
key |
|
The identifier of the plugin module. This key must be unique within the plugin where it is defined.
Sometimes you will need to uniquely identify a module. Do this with the module complete key. A module with key fred in a plugin with key com.example.modules will have a complete key of com.example.modules:fred. I.e. The identifier of the context parameter. |
N/A |
name |
|
The human-readable name of the plugin module. I.e. The human-readable name of the context parameter. |
The plugin key |
singleton |
|
Indicates whether this plugin module should only have one instance of its class (value='true') or may have more than one instance (value='false').
Support for this attribute varies between applications (JIRA, Confluence, etc). |
false |
system |
|
Indicates whether this plugin module is a system plugin module (value='true') or not (value='false'). |
false |
Elements
Name |
Required |
Description |
Default |
description |
|
The description of the plugin module. The 'key' attribute can be specified to declare a localisation key for the value instead of text in the element body. I.e. the description of the listener. |
|
param |
|
Parameters for the plugin module. Use the 'key' attribute to declare the parameter key, then specify the value in either the 'value' attribute or the element body. This element may be repeated. An example is the configuration link described in Adding a Configuration UI for your Plugin. |
N/A |
param-name |
|
The servlet context parameter name. |
N/A |
param-value |
|
The servlet context parameter value. |
N/A |
resource |
|
A resource for this plugin module. This element may be repeated. A 'resource' is a non-Java file that a plugin may need in order to operate. Refer to Adding Plugin and Module Resources for details on defining a resource. |
N/A |
Example
Here is an example atlassian-plugin.xml file containing a single servlet context parameter:
<atlassian-plugin name="Hello World" key="example.plugin.helloworld" pluginsVersion="2">
<plugin-info>
<description>A basic Servlet context parameter module test</description>
<vendor name="Atlassian Software Systems" url="http://www.atlassian.com"/>
<version>1.0</version>
</plugin-info>
<servlet-context-parameter key="helloWorld">
<description>Sets the Hello World text.</description>
<param-name>text</param-name>
<param-value>Hello World!</param-value>
</servlet-context-parameter>
</atlassian-plugin>
Notes
Some information to be aware of when developing or configuring a Servlet Context Parameter plugin module:
- This parameter will only be available to servlets, filters, and context listeners within your plugin.
RELATED TOPICS
Writing Confluence Plugins
Installing and Configuring Plugins Manually
|