Servlet Plugin Module
Servlet plugin modules are available in JIRA 3.5 and later.
Purpose of this Module Type
Servlet plugin modules enable you to deploy Java servlets as a part of your plugins.
The root element for the Servlet plugin module is
servlet. It allows the following attributes and child elements for configuration:
The servlet Java class. Must be a subclass of
Indicate whether the plugin module should be disabled by default (value='disabled') or enabled by default (value='enabled').
The localisation key for the human-readable name of the plugin module.
In the example,
The human-readable name of the plugin module.
The plugin key.
Indicates whether this plugin module is a system plugin module (value='true') or not (value='false'). Only available for non-OSGi plugins.
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.
Initialisation parameters for the servlet, specified using
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 Resources to your Project for details on defining a resource.
The pattern of the URL to match. This element may be repeated.
The URL pattern format is used in Atlassian plugin types to map them to URLs. On the whole, the pattern rules are consistent with those defined in the Servlet 2.3 API. The following wildcards are supported:
Here is an example
atlassian-plugin.xml file containing a single servlet:
Accessing your Servlet
Your servlet will be accessible within the Atlassian web application via each
url-pattern you specify, beneath the
/plugins/servlet parent path.
For example, if you specify a
/helloworld as above, and your Atlassian application was deployed at http://yourserver/jira — then your servlet would be accessed at http://yourserver/jira/plugins/servlet/helloworld .
Some information to be aware of when developing or configuring a Servlet plugin module:
- Your servlet's
init()method will not be called on web application startup, as for a normal servlet. Instead, this method will be called the first time your servlet is accessed after each time it is enabled. This means that if you disable a plugin containing a servlet, or a single servlet module, and re-enable it again, the servlet is re-instantiated and its
init()method will be called again.
- Because all servlet modules are deployed beneath a common
/plugins/servletroot, be careful when choosing each
url-patternunder which your servlet is deployed. It is recommended to use a value that will always be unique to the world!
Information sourced from Plugin Framework documentation