On Dec 15, 2007 12:34 AM, John C. Turnbull <[EMAIL PROTECTED]> wrote:

>  What I don't understand is how the servlet maintains the connection to
> the applet and exactly how the methods in the applet are invoked from the
> servlet.
>
im not very sure how this works either.  if i were to guess; id say in its
simplest form, rather than sending data back to the browser and terminating
execution;
data is sent periodically in the body of a loop.

> In the examples of Comet given, the messages sent back to the "client" are
> through HTML posts which contain JavaScript.
>
there are a few different techniques that differ based upon the content of
the data returned by the server.
script centric; this contains javascript
data centric; xml or json
content centric; xhtml

so you can favor one or mix and match to suit your needs.
the prototype library (and ruby on rails [not that i use it ;)] tend to
favor a content centric approach.

> Would it work the same way for applet?  I mean is it a case that the
> servlet sends back HTML with embedded JavaScript calls which then invoke
> methods on the applet or is there a more direct way to invoke the applet
> methods directly?
>
i imagine this would be very similar, in general.  rather than invoking
applet methods directly though, i imagine they would be invoked indirectly.
the best thing i can conjure up is a client-side controller.  so lets say
the server sends data over to the client; the data can represent whatever,
like say class names, object instance names, actual parameters, and so
forth.  given this data the client side controller could dispatch them.
well suited for the command pattern, i believe, (dont quote me on that [ive
yet to implement command pattern..])

-nathan
_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to