Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I map the url of my web item to a servlet

John Honey May 23, 2023

I am trying to create a jira plug in so for that i created a web item in required place and now iam not able to map the url while clicking the web item to the servlet, I tried changing the web.XML of the plug in but it's not working do i want to make any change in web. XML of Tomcat 

1 answer

0 votes
Graham Twine
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 29, 2023

Hello @John Honey 

 

There is no need to change the tomcat web.xml file for a Jira plugin.

This is configured in the plugin.xml

 

Your web item xml may look like this. All it contains is a link in the UI, admin panel etc.

The link element has a url in there that will be invoked when it is clicked

 
<web-item key="${atlassian.plugin.key}-EventListenerMenuItem"
name="Admin Menu : Event Listener Configuration Menu Link"
section="admin_plugins_menu/${atlassian.plugin.key}-AdminMenu"
weight="131"
application="jira">
<description>Event Listener Configuration</description>
<label key="el.admin.label" />
<link linkId="${atlassian.plugin.key}-EventListenerAdminLink">
/plugins/servlet/eventlistener/admin
</link>
</web-item

 

An additional element to listen for the request.

<!-- Configuration Servlet -->

<servlet key="${atlassian.plugin.key}-EventListenerAdminConfig"
name="Event Listener : Configuration"
class="za.co.liquidesign.jira.admin.events.EventListenerAdmin">
<url-pattern>/eventlistener/admin</url-pattern>
</servlet>

 

The class referenced in the servlet element

public class EventListenerAdmin extends HttpServlet {
@ @Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {

}
}

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events