문제

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.

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top