Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Jira Plugin Development: Linking to Files

Carl Nolan
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 30, 2012

Hi,

I'm having a problem linking to JSP files from within my plugin. The plugin is the type 2 one (the one you drop in /installed-plugins). I want to add a link to the top navigational bar which links to a jsp page which will pull some data and display it or whatever.

I've got the link on the navigation bar but I can't seem to link it correctly to the JSP page. My directory structure is this:

/
	src/
		main/
			java/
			resources/
				webpages/
					DashLinksHome.jsp
				atlassian-plugin.xml
	pom.xml

The web-item as declared in atlassian-plugin.xml is:

<web-item key="roadmap_link" name="DashLinks" section="system.top.navigation.bar"  system="true" weight="13">
		<label key="DashLinks" />
		<tooltip key="DashLinks Tooltip" />
		<link linkId="dashlinkslink">/webpages/DashLinksHome.jsp</link>
		<condition class="com.atlassian.jira.plugin.webfragment.conditions.UserHasVisibleProjectsCondition">
			<param name="permission">browse</param>
		</condition>
	</web-item>

I simply get a 404 when I click the link.

Anyone see what I'm doing wrong? I've tried multiple different directory arragements.

Thanks,

Carl

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Verhás István
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 30, 2012

Actually the plugin embedded jsp is not supported :-(

"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."

at https://developer.atlassian.com/display/JIRADEV/JIRA+Webwork+Actions

So you can deploy jsp files separately or use velocity macro or use a Servlet plugin module instead.

Carl Nolan
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 31, 2012

Thanks for your response verhasi.

After endless reading I found the same. I've tried using Velocity templates instead but I've run in to even more problems.

Do you know if there is a way to manually insert a JSP file and have it use objects and methods defined in plugin classes?

Verhás István
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 31, 2012

You can find working sample project at https://studio.plugins.atlassian.com/wiki/display/WSMPL/Webwork+Sample+Plugin. Focus on the 'Announcement Banner'.

Carl Nolan
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.
June 26, 2012

Sorry only saw this now. Velocity templates were the way forward I was just over-complicating them as usual. Thanks for the help

TAGS
AUG Leaders

Atlassian Community Events