Hello,

I've managed to get a very rough implementation of cometd working with
tapestry/jetty/dojo.  I've implemented it as a component, you can get
the source from here:
http://www.spry.net.au/?q=node/10

To get the full effect open up 2 browsers and point them at the webapp.

I'm putting this up for people to have a look at and it is by no way
production ready, so please don't expect it to scale, work reliably or
even work at all.

I have only run this using, using Sun's JDK 1.5.0_11 and Maven: 
mvn jetty:run

So I don't know if it will work using other JSP containers or JDKs.

Now for the nitty gritty, from here on in I assume you know something
about cometd.  To get this to work I have a function that is listening,
when data needs to be pushed to the page, I get the sever to publish an
event, on the client side the data is ignored and the function that is
listening calls the onclick() function of a component on the page, which
does what ever you want.

I tried to send through rendered content to the listening function, but
I couldn't work out how to get tapestry to genterate a response without
a request.

To use this component in the .html file you will need a line that looks
like this:
<span jwcid ="cometd" />

In the .page file:
<component id="cometd" type="Cometd">
                <binding name="webapp" value="literal:cometchat"/>
        <binding name="topic" value="literal:/pages/test"/>
        <binding name="clickComponent" value="literal:clickMe"/>
    </component>

Where webapp is the containing web application, the topic is what the
server will be publishing on and the pages will be listening and click
component is the id of the component that will be called by the
listening function, ie when a cometd event happens on topic
'/pages/test' clickMe.onclick() will be called on your web page.

I wouldn't recommend using what I have done to learn about cometd, to do
this get the jetty source code from subversion and look at the
cometd-demo in the contrib directory.

Well there it is, take it for what it is and I'll keep posting
improvements to the above site as I make them I think there is plenty of
room for improvements.

Craig  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to