如何在Jersey 2.0中使用guice-servlet?

Gil*_*ili 29 guice-servlet jersey-2.0

有没有示例代码演示如何在Jersey 2.0中使用guice-servlet?

Gil*_*ili 9

https://github.com/Squarespace/jersey2-guice似乎是泽西2的第一个真正的Guice集成,但它需要2.11+版本.

注意:我没有测试过这个,但这个想法很合理.


Pie*_*syP 5

是的,我已经改编了一个例子,它可以在这里找到 - https://github.com/piersy/jersey2-guice-example-with-test

我现在更新了示例代码,它使用jetty进行测试,另一个使用tomcat进行测试.