开发者

Using GWT + Twitter4j

I am trying to build a simple gwt project that fetches tweets and displays them.The server passes back the tweets of type twitter4j.Tweet to the client. Both modules import twitter4j.Tweet. But when I run I get the following error: --- ERROR: Line 37: No source code is available for type twitter4j.Tweet; did you forget to inherit a required module?. I seem to have problems in inheriting twitter4j. All the posts I have seen about inheriting a jar file are not clear about how to do so. I understand I开发者_开发技巧 must write an inheritance instruction into gwt.xml file, something like --- but if I try --- it does not work. Can anyone please explain?

In a post I found on the Web one person suggested not to inherit it but: -- Don't put twitter4j to your gwt.xml. Just add it your project class path. and make all functionalities like status updating and all in your serviceImpl. Try

This confuses me even more. I have added the jar file to my project libraries. But it does not work I suspect I am missing something quite elementary here, but I am totally stuck. Is there something like a GWT path? Many thanks for any help


Keep in mind that everything in your client package is compiled to JavaScript and executed in the user's browser. Thus, you'll only be able to use twitter4j's classes on the server-side of your application; you'll have to create some sort of light-weight GWT-serializable "proxy object" to pass data back and forth between your client and server tiers.

Since you can't use twitter4j on the client side of your app, you will not need anything in your .gwt.xml file referencing it. Instead, you'll add twitter4j to your classpath and do all your updating on the server side (as mentioned toward the bottom of your question). You do mention that it "does not work," but there's not enough information in your question to try to figure out why.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜