It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to link a web-item to a servlet rendering soy template to show up in repository settings?

I am using latest bitbucket server and trying to add some configuration form to repository settings page under add-ons section. This configuration is specific for each repository. I was able to add a web-tem which shows up as a link under add-ons in repository settings. Now i would like link this web-item to a servlet to render the configuration page (built using soy template). when my link is clicked, It shows up a 404. I couldn't find any doc related to this configuration.

1. What is the <link> value that i should be using to invoke my servlet? Here is what i am using.

<web-item name="My Configuration Tab" key="My-configuration-tab" section="bitbucket.repository.settings.panel/repository-settings-addons-section">
<label key="My Configuration">My Configuration</label>
<link linkId="My-configuration-tab-link">/projects/${project.key}/repos/${repository.slug}/settings/configservlet</link>
<tooltip key="My-configuration-tab.tooltip">My Configuration</tooltip>

2. What is the corresponding url-pattern i should be using ? Here's what i have

<servlet name="My Config Servlet Module" i18n-name-key="" key="my-config-servlet" class="">
<description key="my-config-servlet.description">The My Config Servlet Plugin</description>

3. What is the meta tag that i should be using in soy template? Here's what i have

<meta name="decorator" content="bitbucket.repository.settings">

Other than above 3, are there any other things i need to have to get this working?

2 answers

1 accepted

0 votes
Answer accepted
Daniel Wester Community Leader Oct 22, 2017

You’re using a servlet so the path to it rooted at /plugins/servlet

so the link should be:


It is still giving the 404 error. I tried this.

1. Inside web-item i gave this link path

<link linkId="my-configuration-tab-link">/plugins/servlet/settings/configservlet</link>


2. Inside the servlet i gave the below path.



Did i miss anything? does the above path in <link> links to repository settings? What is the best way to debug this?

Thanks for the help.

Daniel Wester Community Leader Oct 23, 2017

Make the url-pattern in the servlet be:



By specifying



-the actual url pattern is /plugins/servlet/*/settings/configservlet

 - which you probably don't want :)


The other piece I would suggest is to have your add-on name in the url-pattern somewhere to avoid another add-on collding with your paths ( for example I try to have the Wittified add-ons at /wittified/....). This way likelihood of somebody else having the same path is a lot smaller :)

Thanks Daniel. that worked. In addition to the above one, i had to make few more changes in my soy template and in the servlet.

- I have added the necessary meta tags required for the repository settings decorater in the soy template.

<meta name="decorator" content="bitbucket.repository.settings">
<meta name="projectKey" content="{$repository.project.key}">
<meta name="repositorySlug" content="{$repository.slug}">

- I have declared the repository param in the soy template.

* @param repository Repository object

- I have passed in the project and repository names as part of the <link> tag and used those inside my servlet to get a repository instance like this and passed it on to the renderer.

<link linkId="my-configuration-tab-link">/plugins/servlet/settings/myconfig/${project.key}/${repository.slug}</link>
String pathInfo = req.getPathInfo();
String[] path = pathInfo.split("/");
String project = path[path.length-2];
String repo = path[path.length-1];
Repository repository = repositoryService.getBySlug(project, repo);


Hope this info helps someone with similar needs.

0 votes


Try to use 


Sorry that didn't wok.  it still gives 404. I was building on top of decorator-plugin example. if i use the <link> , <url-pattern>, <meta> tags from that example it works but opens in user accounts section.  Any other suggestions?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

681 views 0 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you