Support Servlets with AutoConfig
Closed this issue · 4 comments
Currently, servlets are ignored when using AutoConfig
. This requires a finicky workaround in the Application
class to save the injector to an instance variable during bootstrapping, using that to manually inject a servlet, wrap it in a holder, and add to the environment's getApplicationContext()
.
In short, it would be nice if Servlets were added and injected like Jersey Resources.
Sure thing. Why don't you submit a PR?
On Sun, Jun 1, 2014 at 8:11 PM, Jarrod Davis notifications@github.com
wrote:
Currently, servlets are ignored when using AutoConfig. This requires a
finicky workaround in the Application class to save the injector to an
instance variable during bootstrapping, using that to manually inject a
servlet, wrap it in a holder, and add to the environment's
getApplicationContext().In short, it would be nice if Servlets were added and injected like Jersey
Resources.—
Reply to this email directly or view it on GitHub
#29.
I will once I have time. This project (along with Dropwizard itself) as saved me quite a bit of time and headache (after trying several other options), so I'll definitely contribute once I can make some time. Might be a few weeks, though.
How would the AutoConfig know the path for servlets?
I've had a go at this using a custom annotation: https://github.com/mlk/dropwizard-guice/tree/29_servlet_support but I'm not sure if this is the right way to go about it.
Closing due to inactivity