PluginServlet.java_support_registering_servlets_programmatically.patch

Description

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.

Fixed

Details

Assignee

Reporter

Labels

Components

Fix versions

Affects versions

Priority

Created November 26, 2012 at 1:10 PM
Updated April 28, 2014 at 5:39 PM
Resolved April 28, 2014 at 5:39 PM

Flag notifications