Re: [Resin-interest] Resin, Comet & applets - anyone?

2007-12-14 Thread Nathan Nobbe
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


Re: [Resin-interest] Resin, Comet & applets - anyone?

2007-12-14 Thread John C. Turnbull
Thanks Nathan,

 

I believe an applet can use an HttpURLConnection to connect to and invoke a
servlet so I think that covers what you are saying.  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.  In the examples of
Comet given, the messages sent back to the "client" are through HTML posts
which contain JavaScript.  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?

 

Thanks,

 

-JCT

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Nathan Nobbe
Sent: Saturday, 15 December 2007 11:10
To: General Discussion for the Resin application server
Subject: Re: [Resin-interest] Resin, Comet & applets - anyone?

 

On Dec 14, 2007 5:34 PM, John C. Turnbull <[EMAIL PROTECTED]> wrote:

Has anyone tried using a combination of Resin, Comet and applets?  I see
examples using Comet with HTML-based technologies but is this also possible
for plain old applets?  I can't figure out how it would work (or IF it would
work).

ive done only crude work with applets; many years ago at that.
however, if applets have a way to send an http request to the server
it is conceivable that the 'comet effect' could be recreated with them. 
basically, all comet does is keep the http connection open.
its expensive, but as you know offers the ability to 'push' to the client.

-nathan

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


Re: [Resin-interest] Resin, Comet & applets - anyone?

2007-12-14 Thread Nathan Nobbe
On Dec 14, 2007 5:34 PM, John C. Turnbull <[EMAIL PROTECTED]> wrote:

>  Has anyone tried using a combination of Resin, Comet and applets?  I see
> examples using Comet with HTML-based technologies but is this also possible
> for plain old applets?  I can't figure out how it would work (or IF it would
> work).
>
ive done only crude work with applets; many years ago at that.
however, if applets have a way to send an http request to the server
it is conceivable that the 'comet effect' could be recreated with them.
basically, all comet does is keep the http connection open.
its expensive, but as you know offers the ability to 'push' to the client.

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