This page last changed on Jan 24, 2006 by jnolen.

Cannot resolve external resource into attachment. How do I write a servlet for JIRA?

As fo JIRA 3.5, there's a new Servlet Plugin type.

First, see the JIRA WebWork Plugin type. But if you can't use a plugin for some reason, you can follow these instructions:

JIRA uses Webwork, which manages things from a central servlet. To write a new .jspa page ('action'), you would:

  • Edit WEB-INF/classes/actions.xml and a section for your page:
    <action name="MyPage" alias="MyPage">
            <view name="success">/views/mypage.jsp</view>
        </action>
    

     

  • Create the MyPage action class, eg. in 3.4-beta1 Standalone, create external-source/src/MyPage.java as shown below and run 'ant' in external-source/ to compile.
    package com.atlassian.jira.web.action;
    
    public class MyPage extends JiraWebActionSupport
    {
            public String getName() {
                    return "Fred";
            }
    }
    

     

  • Create the JSP, eg. in atlassian-jira/views/mypage.jsp:
    <%@ taglib uri="webwork" prefix="webwork" %>
    Hello there, <webwork:property value="name"/>
    

     

  • Restart, and request /secure/MyPage.jspa
Document generated by Confluence on Oct 06, 2009 00:31