« Return to Thread: DWR and Guice

Re: DWR and Guice

by Joe Walker-3 :: Rate this Message:

Reply to Author | View in Thread

Some parts of this message have been removed. Learn more about Nabble's security policy.

Cool - so would you like to submit some classes for Guice support?

Joe.

On 3/21/07, tpeierls <tim@...> wrote:
So has anyone else been thinking about how to integrate DWR and Guice? I have!

Here's what I have so far:

  • an abstract class GuiceServletContextListener that extends AbstractModule, creates an Injector based on the results of its own configuration, and stores that Injector in the servlet context;
  • a GuiceCreator class that uses the Injector stored in the servlet context to getInstance of the appropriate class; and
  • a web.xml that installs a concrete extension of GuiceServletContextListener, adds the GuiceFilter to the filter chain, and uses a customConfigurator extending FluentConfigurator to configure the DwrServlet.

My sample DWR webapp uses no XML beyond web.xml, which seems to be the Guice Grail.

The slightly odd thing is that @RemoteProxy classes use DWR scoping to decide when they should be created, but everything injected into them uses Guice scopes.

--tim


View this message in context: DWR and Guice
Sent from the DWR - Dev mailing list archive at Nabble.com.


 « Return to Thread: DWR and Guice

LightInTheBox - Buy quality products at wholesale price!