comet
dojo.io.bind for tomcat 6 comet
Posted June 20th, 2007 by mailarchiveHere is a basic example what I did, using dojo.io.cometd, and Jetty
Continuations within Tomcat 5.5. OOTB "long-polling" transport was
selected by default, also note I have some additional connects to
functions for tracking lifecycle of connection but those are not
strictly required. Also note that using the Jetty module requires
additional configuration via. web.xml. As long as it's cometd / Bayeux
protocol, this client side code should work with Tomcat 6 AFAIK:
1) Setup the connection when the page loads
dojo.require("dojo.io.cometd");
function setUpConnection(){
dojo.event.connect(cometd,"finishInit",function(type, data, evt,
request){
//alert("Finished Initializing.." + request);
transportObject = request;
//
// subscribe once connection is finished initializing
//
cometd.subscribe("/events/received", true, "serverSentEvent");
// was +cometd.clientId;
});
dojo.event.connect(cometd,"tunnelInit",function(type, data, evt,
request){
alert("TunnelInit...");
});
cometd.init({}, "/appcontextpath/cometd"); // replace appcontextpath
with your applications context path
// cometd.subscribe("/events/received", true, "serverSentEvent");
// set connected state for page
// this should possibly only be set on callback notification
connected = true;
}
2) serverSentEvent is the callback function for when a message is
received. In my case I take the callback and publish it's contents to a
topic locally in the browser, using dojo.event.topic, but that's not
require.
3) publish a message to "/events/received", for testing you can setup a
JS function on the same page for testing
function testDOJOEvent(){
cometd.publish("/events/received", {
source: cometd.clientId
});
}
Here I'm just pinging, with no message sent. I also have a Java client
that posts messages on the same channel from the server side (i.e. to
send events to the browser), via org.mortbay.cometd.Channel.publish(). I
believe there is also a chat example floating around on the net that
should be applicable as well.
HTH,
Mike
dojo.io.bind for tomcat 6 comet implementation
Posted June 20th, 2007 by mailarchiveHi,
I have a tomcat 6 CometProcessor servlet which periodically sends messages
to the client page. Now I'm trying to create a html page with dojo
javascript which shows the received messages. But I don't find an working
example, and all my attempt lead to errors.
What is the right transport mode? XmlHttpRequest or IframeTransport?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dojotoolkit.org/pipermail/dojo-interest/attachments/20070604/b9fa...
comet + streaming httpd howto
Posted June 20th, 2007 by mailarchiveHello,
I am looking for example code for the use of dojo.comet
THe API docs are not complete and I do not see any test examples.. I am able to
use bind() to do regular ajax but I need to utilize the responseText for
dynamic updates.. ( otherwise I have to wait for the AJAX connection to
complete before I see results.. Id rather stream them )
Anyone?
thanks in advance.
-matt
comet style io with multiple windows?
Posted June 20th, 2007 by mailarchiveI've been working on a comet like thing for an application that uses pop-up
windows. Along the way I've run into some very tough puzzles about how to
maintain just one open connection.
Basically the problem is (as I see it) that for comet to work well it needs
to have only one connection. My tests show that only one window can have
that connection or they clobber each other. So the plan is to have one
window be the only opener for the pop-ups and that the pop-ups would be fed
data from the opener. But what if the opener refreshes, closes or goes to
another URL? Also, what if the opener URL is opened in another window? If
the opener is refreshed, the child windows can re-register themselves in the
opener. If the opener closes or goes to another URL, though, I don't see any
good way to manage the comet connection. And if the opener is opened in two
windows, is there any reliable way to determine which gets the comet
connection?
I think the "real" solution for this is to have the browsers support a
connection pool accessable via javascript with IDs or something. Oh well.
... So far, the only "reality-based" solution I can think of is to just use
regular ajax polling. But what do I know?
Does dojo's io package offer anything to help with this stuff? I haven't
been using dojo's io package so far so pardon my ignorance please.
???
,chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dojotoolkit.org/pipermail/dojo-interest/attachments/20061004/068b...
Comet implementation
Posted June 20th, 2007 by mailarchivehi all,
i am trying to implement comet using dojo within my web app. can
somebody help me out in implementing it. i am also looking at trying
json or anyting else which will quickly allow my app to receive data
from the server w/o a page refresh. i am using tapestry and tomcat.
any help is appreciated. thanks.
Re: EmergeTk -- C# bindings for dojo, comet.
Posted June 20th, 2007 by mailarchiveHi Ben,
I've been checking your project religiously ever since your posted a
hint on the dojo blog 2 months ago. At one point I even managed to
uncover the prototype home page digging through the links on your blog.
Anyways forgive my obtusity but reading through the code I still can't
seem to figure out how exactly you are binding to dojo itself and what
the mechanisms for working this binding are. Or in other words I can see
and understand your framework, I just don't notice dojo in it, although
it's lying in the bin folder :) Hmm must be something just round the
corner, possibly in the Widget.cs or client_master.js but I would have
expected more a class-for-class binding like .NET does for the standard
windows API. You must be doing some heavy duty runtime reflection magic.
Could you provide a short overview of what is going on and where it will
go from here in relation to the dojo part?
EmergeTk -- C# bindings for dojo, comet.
Posted June 20th, 2007 by mailarchiveHello all,
I just released the first version of my GPL web toolkit, emergetk. I'm
using Dojo (0.2.2) on the client, and provide server-side wrappers to a lot
of the widgets in the dojo class hierarchy. I'm using many other parts of
dojo, besides the widgets (bind, events, drag & drop, incl SVG support.) I
also provide a comet-style streaming socket mode, which works well with my
live, two-way databinding layer.
If you'd like to see more about it, the website is:
I'd love to hear any feedback - it's still in a very early stage.
cheers,
--
ben joldersma
http://ben.creationsnetwork.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dojotoolkit.org/pipermail/dojo-interest/attachments/20060531/a502...
Comet
Posted June 20th, 2007 by mailarchiveHow can I implement Comet with dojo.io.bind()?
Thanks
Raf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mastodon.dojotoolkit.org/pipermail/dojo-interest/attachments/2006...
Re: Comet
Posted June 20th, 2007 by mailarchiveHi Greg!
On Thursday 30 March 2006 5:58 am, Greg Wilkins wrote:
Interesting. I'd love to see that as well. Right now I'm working on what
will (hopefully) be a portable client for soemthing like this. There's
a Perl-centric implementation happening under the name of "ShortBus"
and I'm working on a stand-alone Twisted variant. Once we've got those
mostly functional, I think we should publish the JSON format and HTTP
endpoint verbs which would let you easily implement it.
If you'd like to be involved sooner while we're figuring out some of the
path router semantics, let me know.
Regards
--
Alex Russell
alex@jot.com
alex@dojotoolkit.org BE03 E88D EABB 2116 CC49 8259 CF78 E242 59C3 9723
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
Url : http://mastodon.dojotoolkit.org/pipermail/dojo-interest/attachments/2006...
Dojo Forum