integrating GWT with CDI (Seam/Weld)

倖福魔咒の 提交于 2019-12-12 20:30:24

问题


What's the best way to integrate CDI with GWT? In particular, I'd like to know how to make dependency injection work for my RemoteServiceServlet extensions. Apparently CDI won't work with classes derived from javax.servlet.Servlet. I'm happy to ditch RemoteServiceServlet if there is an alternative.

I don't really need DI on the GWT client-side, but would happily use it if it Just Worked.


回答1:


It turns out to be a bug in Weld, which is already fixed in version 1.1.0.

Intellij IDEA X also has this "bug", as it flags it as an error if you try to do this with a RemoteServiceServlet. I just disabled the inspection for that.




回答2:


I believe Errai is what you're looking for if you want to integrate CDI with GWT. I haven't used it myself on a real project but it looks really cool. It will even bridge CDI events between the browser and your server and can pretty much replace the existing GWT RPC mechanism.



来源:https://stackoverflow.com/questions/4809596/integrating-gwt-with-cdi-seam-weld

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!