google-code-export / google-guice

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

RequestScoped Servlet example is need. #383

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
i want inject dao to servlet.
dao need a requestscope.
but i dont know how to use it.i read some demo in wrap servlet.
there are some different with guice servlet.
guice servlet is only sington.

thanks .

Original issue reported on code.google.com by wee.jul...@gmail.com on 9 Jun 2009 at 2:22

GoogleCodeExporter commented 9 years ago
Hi, you can inject a Provider<Dao> into the servlet instead. This will allow 
you to leave the Dao as request-
scoped and only access it in side a request.

Original comment by dha...@gmail.com on 9 Jun 2009 at 6:01

GoogleCodeExporter commented 9 years ago

Original comment by limpbizkit on 22 Jun 2009 at 2:24