Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
I don't think that the current way of parsing a subset of the web.xml allows for good dependency injection on the servlets and nice error detection during a plugin's initialization. This patch adds support for registering servlet programmatically from plugins.
The followg snippet is an example of how I am using this: MyServlet servlet = new MyServlet(); servlet.setMyPlugin(this); this.publicUrl = PluginServlet.registerServlet(manager, this, servlet, THE_URL); servlet.setUrl(this.publicUrl); servlet.init(); AuthCheckFilter.addExclude(this.publicUrl);
Environment
Linux
Attachments
1
26 Nov 2012, 01:10 PM
Activity
Show:
Tom Evans April 28, 2014 at 5:39 PM
Applied patch as provided.
Tom Evans April 28, 2014 at 5:12 PM
Seems pretty straightforward, not a significant departure from what we already allow via configuration (web.xml).
Daryl Herzmann April 27, 2014 at 5:13 PM
Hi Tom, Would you kindly provide some comments on this patch? Thanks
Daryl Herzmann February 13, 2014 at 9:52 PM
Assigning to next release in hopes of a code review.
I don't think that the current way of parsing a subset of the web.xml allows for good dependency injection on the servlets and nice error detection during a plugin's initialization.
This patch adds support for registering servlet programmatically from plugins.
The followg snippet is an example of how I am using this:
MyServlet servlet = new MyServlet();
servlet.setMyPlugin(this);
this.publicUrl = PluginServlet.registerServlet(manager, this,
servlet, THE_URL);
servlet.setUrl(this.publicUrl);
servlet.init();
AuthCheckFilter.addExclude(this.publicUrl);