Servlet Context Parameter Plugin Module

Available:

Bamboo 2.5 and later

On this page:

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 class
Required  
Description 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. See the plugin framework guide to creating plugin module instances.
Default  

Name state
Required  
Description Indicate whether the plugin module should be disabled by default (value='disabled') or enabled by default (value='enabled').
Default  enabled

Name i18n-name-key
Required  
Description The localisation key for the human-readable name of the plugin module.
Default  

Name key
Required  Yes
Description The unique identifier of the plugin module. You refer to this key to use the resource from other contexts in your plugin, such as from the plugin Java code or JavaScript resources.
<component-import key="appProps" interface="com.atlassian.sal.api.ApplicationProperties"/>

In the example, appProps is the key for this particular module declaration, for component-import, in this case.

I.e. The identifier of the context parameter.
Default  N/A

Name name
Required  
Description The human-readable name of the plugin module. I.e. The human-readable name of the context parameter.
Default The plugin key

Name system
Required  
Description Indicates whether this plugin module is a system plugin module (value='true') or not (value='false'). Only available for non-OSGi plugins.
Default false

Elements

Name description
Required  
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.
Default  

Name param-name
Required Yes
Description The servlet context parameter name.
Default N/A

Name param-value
Required Yes
Description The servlet context parameter value.
Default 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" plugins-version="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-param key="helloWorld">
        <description>Sets the Hello World text.</description>
        <param-name>text</param-name>
        <param-value>Hello World!</param-value>
    </servlet-context-param>
</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.

Was this page helpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport