Wednesday, September 22, 2010

Re: Chat with GWT

Hi,

you can't call getMessage() from the servlet.
You seems to have a weird understanding of client-server
communication.

Any class you have showed us are client classes (browser). No idea how
you call anything from servlet.
You may use GWT-RPC for communication (and you should have a look on
COMET if you want to make a chat app)

Just follow the stockwatcher sample and you get the necessary
information.

http://code.google.com/intl/de-DE/webtoolkit/doc/latest/tutorial/clientserver.html


Stefan Bachert
http://gwtworld.de

On 21 Sep., 05:07, Victor Machado <victor_...@hotmail.com> wrote:
> Hello, im new in programming with GWT and im trying to make a Chat
> application.
> I have a class Receiver, responsible to get the messages from the
> server and show them in a TextArea.
> It's something like this:
>
> class ChatEntryPoint implements EntryPoint{
>
>       Receiver r;
>       final TextArea ta;
>
>       public void onModuleLoad() {
>
>            r = new Receiver(id){
>
>                         @Override
>                         public void getMessage(String msg) {
>                                 ta.setText(msg);
>                         }
>
>                 };
>       }
>
> }
>
> public class Receiver implements java.io.Serializable{
>
>         private static final long serialVersionUID = -2358499438887497539L;
>         private String id;
>
>         public Receiver(){
>                 this.id = "";
>         }
>
>         public Receiver(String id){
>                 this.id = id;
>         }
>
>         public void getMessage(String msg) {
>         }
>
> }
>
> Even assigning the java.io.Serializable, i get the serialization error
> message, when i call the getMessage method from my Servlet.
> What is wrong with my Receiver?
>
> Ps: Please, forgive my bad english.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment