JIRA Webwork Actions
Webwork Actions and
A web application framework defines what happens when you visit a particular URL in a web application. For example, the URL for a simple static page with no dynamic content could end in ".html". A ".jspa" suffix indicates that the URL is referring to a page whose content was created using Java Server Pages (JSP). JSP files are templates that can contain both HTML and commands to create HTML. The commands refer to a Java object and the object's methods are called just as in an ordinary Java program. The mapping of the URL to a Java class in JIRA is done using the Webwork 1.x web application framework. The original documentation for Webwork 1.x can be found at http://opensymphony.com/webwork_old/src/docs/manual and http://wiki.opensymphony.com/display/WW1/Home. However, this framework has been superseded by Webwork 2, which is used by Confluence, Bamboo and Crowd
The mappings between a URL and classes are declared in the actions.xml file (
src/webapp/WEB-INF/classes/actions.xml). A typical element of this file looks like:
Each action element has an
alias attribute, which is the part of the URL that you see in a web browser. The
name element is the name of the Java class that is used by the
Command elements are optional, and are used when several interactions belong to the same Action. A command name is specified on the URL like this:
The command is implemented in a method in the Action class with the corresponding name:
The doExecute method is run when no command is requested i.e. the bare
JIRA can have new actions defined using the Webwork plugin module. These actions can also override existing actions in JIRA.
However, jsp files cannot currently be bundled in the plugin jar file and have to be installed in a separate step when deploying such a plugin.
There is a Webwork Sample plugin that contains example actions and classes that can be used to understand this topic more fully.