ericmckean / wave-protocol

Automatically exported from code.google.com/p/wave-protocol
0 stars 0 forks source link

Facilitate the registration of other servlets and the injection of WIAB instances #235

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In other to integrate WIAB with other projects or to extend it easily, it will 
be useful to permit the:
- use of the same Guice injector (the last created child injector),
- the injection of WIAB instances in other projects code
- and to permit to register other servlets via an optional web.xml

This can be accomplished by adding an attribute in the context with the 
injector, and also using WebAppContext instead of the ServletContextHandler.

In the web.xml we can register other servlets/filters and for instance we can 
use GuiceFilter:
https://google-guice.googlecode.com/svn/trunk/javadoc/com/google/inject/servlet/
GuiceFilter.html

and inject and reuse the WIAB instances in other projects that want to 
integrate WIAB.

This is the way we are integrating WIAB in our project (that also use Guice) 
and our proposal to facilitate the integration of other server codes. I think 
that can be useful for other projects or a start point.

A proposed patch:
http://codereview.waveprotocol.org/552005 

Original issue reported on code.google.com by vruiz.ju...@gmail.com on 4 Mar 2011 at 7:23

GoogleCodeExporter commented 9 years ago
Some samples to test the previous patch (if you want to test it, you will need 
guice-servlet as an additional dependency).

Original comment by vruiz.ju...@gmail.com on 6 Mar 2011 at 7:54

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed by 925:c6765f3b3f67

Original comment by vega113 on 25 Mar 2011 at 11:28