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);
Linux
Assigning to next release in hopes of a code review.
Hi Tom, Would you kindly provide some comments on this patch? Thanks
Seems pretty straightforward, not a significant departure from what we already allow via configuration (web.xml).
Applied patch as provided.