frjaeger220 / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
0 stars 0 forks source link

ServletModule shouldn't depend on HttpServlet #327

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
ServletModule references HttpServlet instead of Servlet. Jersey doesn't
subclass HttpServlet at all; instead it implements Servlet and Filter
directly. As far as I can tell we don't depend on HttpServlet-specific
functionality anyway, Servlet should be enough.

Original issue reported on code.google.com by gili.tza...@gmail.com on 7 Feb 2009 at 4:56

GoogleCodeExporter commented 9 years ago
Proposed patch

Original comment by gili.tza...@gmail.com on 7 Feb 2009 at 5:17

Attachments:

GoogleCodeExporter commented 9 years ago
Hm, actually this is a deliberate choice for us. It is an error to register 
non-HTTP servlets to ServetModule, coz it 
doesn't know how to serve them.

If Jersey uses a filter there should be no problem? IIRC, JSR-311 does not have 
any non-HTTP functionality.

Original comment by dha...@gmail.com on 7 Feb 2009 at 11:36

GoogleCodeExporter commented 9 years ago
Really? When I modified all references of HttpServlet to Servlet it worked just 
fine
(see the patch). Why do you think ServletModule really needs HttpServlet?

Jersey's ability to run as a Filter is only a week old. Old versions run 
strictly as
a Servlet and users may choose to continue to do so in the future. I'd like to
support plain Servlet if it's possible.

Original comment by gili.tza...@gmail.com on 8 Feb 2009 at 3:00

GoogleCodeExporter commented 9 years ago
As I said, it is a deliberate choice for us.

Since Jersey runs as a Filter now, It seems fair to ask users to prefer that 
method with Guice.

Original comment by dha...@gmail.com on 8 Feb 2009 at 7:46