Re: dwr java chat demo in t5
You would do this by the topic (eg: "/chat/user1"). You can add custom Authorizers for topic security.
Re: dwr java chat demo in t5
Lance, thanks again, i will check the docs. Seems that longpolling or jsonp is supported best by servers and browsers. The first question i will have if there is a kind of client identification built in. The chat messages must be propageted to the correct users and not to all users. Is a client identification part of the project or does this completely depends on my own businesslogic? Kind regards David On 23.05.2013 09:44, Lance Java wrote: > tapestry-cometd is built using the cometd integration in atmosphere. > Atmosphere supports a variety of push mechanisms including WebSockets, > Server Side Events (SSE), Long-Polling, HTTP Streaming (Forever frame) and > JSONP. > > Out of the box, tapestry-cometd is configured to use > org.cometd.websocket.server.WebSocketTransport but this can be configured > in your AppModule ( > https://github.com/uklance/tapestry-cometd/blob/master/src/main/java/org/lazan/t5/cometd/services/CometdModule.java#L54 > ) > > The supported servers and browsers are listed here: > https://github.com/Atmosphere/atmosphere/wiki/Supported-WebServers-and-Browsers > > Some more docs here > https://github.com/Atmosphere/atmosphere > https://github.com/Atmosphere/atmosphere/wiki/Getting-started-with-Cometd > https://github.com/uklance/tapestry-cometd/wiki/Configuring-the-CometD-Servlet > http://cometd.org/ > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: dwr java chat demo in t5
The supported browsers section on the atmosphere page can be ignored as this refers to atmosphere.js which is not used by the cometd integration. Only the supported servers section is relevant. Best to check the cometd docs for supported browsers at www.cometd.org
Re: dwr java chat demo in t5
tapestry-cometd is built using the cometd integration in atmosphere. Atmosphere supports a variety of push mechanisms including WebSockets, Server Side Events (SSE), Long-Polling, HTTP Streaming (Forever frame) and JSONP. Out of the box, tapestry-cometd is configured to use org.cometd.websocket.server.WebSocketTransport but this can be configured in your AppModule ( https://github.com/uklance/tapestry-cometd/blob/master/src/main/java/org/lazan/t5/cometd/services/CometdModule.java#L54 ) The supported servers and browsers are listed here: https://github.com/Atmosphere/atmosphere/wiki/Supported-WebServers-and-Browsers Some more docs here https://github.com/Atmosphere/atmosphere https://github.com/Atmosphere/atmosphere/wiki/Getting-started-with-Cometd https://github.com/uklance/tapestry-cometd/wiki/Configuring-the-CometD-Servlet http://cometd.org/
Re: dwr java chat demo in t5
Hi, Lance, wow, thank you for pointing me to your project! Integration is more than easy, your example works outofthebox in my browsers. I had to install jetty7 support, seems that jetty6 does not support websockets. What are the disadvantages of websockets compared to ajax? I think not all browsers support websockets? Especially the older versions? But i think that all the major browsers support that in their latest versions? I did read that the t5 team want to integrate push, but did not see how this is scheduled. So i want to go with your project. Thanks again, Lance! Kind regards David On 22.05.2013 23:37, Lance Java wrote: > Hi, as a previous dwr committer myself, I was keen to provide dwr reverse > ajax / tapestry integration. > > After speaking to the dwr team, I found that the push mechanism in dwr was > not considered bulletproof and was directed towards cometd > > For this reason, I have created tapestry-cometd, a push library for > tapestry that requires zero javascript > https://github.com/uklance/tapestry-cometd > > You must be aware that the tapestry team currently have push as a high > priority feature for the next release. So watch this space for an out of > the box solution. > > In the meantime, I'll be happy to help with a tapestry - cometd solution . > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: dwr java chat demo in t5
Never mind Lance, Seems I have an error in my configuration. I think I'll be able to figure it out myself. thanks anyhow Jon On Wed, May 22, 2013 at 6:10 PM, Jon Williams wrote: > Hi Lance, > > This email thread caught my eye so I went and got your example app. > It seems to be running, in a fashion. However, > I'm seeing NPE's at runtime... > > 1 caveat, maybe pertinent. I had to add a dependency to the pom to get a > good build... > > org.eclipse.jetty > jetty-server > 7.6.4.v20120524 > > > If you've got a moment, maybe you could take a look. > Quite interested in using your project. > thanks > Jon > > Here my console output... > /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java > -Dmaven.home=/usr/share/java/maven-3.0.4 > -Dclassworlds.conf=/usr/share/java/maven-3.0.4/bin/m2.conf > -Didea.launcher.port=7532 > "-Didea.launcher.bin.path=/Applications/jetbrains2013/IntelliJ IDEA > 12.app/bin" -Dfile.encoding=UTF-8 -classpath > "/usr/share/java/maven-3.0.4/boot/plexus-classworlds-2.4.jar:/Applications/jetbrains2013/IntelliJ > IDEA 12.app/lib/idea_rt.jar" com.intellij.rt.execution.application.AppMain > org.codehaus.classworlds.Launcher --fail-fast --strict-checksums > org.mortbay.jetty:maven-jetty-plugin:6.1.16:run -P jetty-hightide > [INFO] Scanning for projects... > [INFO] > > [INFO] > > [INFO] Building tapestry-cometd-demo Tapestry 5 Application 1.0-SNAPSHOT > [INFO] > > [INFO] > [INFO] >>> maven-jetty-plugin:6.1.16:run (default-cli) @ > tapestry-cometd-demo >>> > [INFO] > [INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ > tapestry-cometd-demo --- > [debug] execute contextualize > [WARNING] Using platform encoding (UTF-8 actually) to copy filtered > resources, i.e. build is platform dependent! > [INFO] Copying 8 resources > [INFO] > [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ > tapestry-cometd-demo --- > [INFO] Nothing to compile - all classes are up to date > [INFO] > [INFO] --- maven-resources-plugin:2.5:testResources > (default-testResources) @ tapestry-cometd-demo --- > [debug] execute contextualize > [WARNING] Using platform encoding (UTF-8 actually) to copy filtered > resources, i.e. build is platform dependent! > [INFO] Copying 1 resource > [INFO] > [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ > tapestry-cometd-demo --- > [INFO] Nothing to compile - all classes are up to date > [INFO] > [INFO] <<< maven-jetty-plugin:6.1.16:run (default-cli) @ > tapestry-cometd-demo <<< > [INFO] > [INFO] --- maven-jetty-plugin:6.1.16:run (default-cli) @ > tapestry-cometd-demo --- > [INFO] Configuring Jetty for project: tapestry-cometd-demo Tapestry 5 > Application > [INFO] Webapp source directory = > /Users/jonwilliams/wrk/java/3rdParty/tapestry-cometd-demo-master/src/main/webapp > [INFO] Reload Mechanic: automatic > [INFO] web.xml file = > /Users/jonwilliams/wrk/java/3rdParty/tapestry-cometd-demo-master/src/main/webapp/WEB-INF/web.xml > [INFO] Classes = > /Users/jonwilliams/wrk/java/3rdParty/tapestry-cometd-demo-master/target/classes > 2013-05-22 18:02:35.124::INFO: Logging to STDERR via > org.mortbay.log.StdErrLog > [INFO] Context path = /tapestry-cometd-demo > [INFO] Tmp directory = determined at runtime > [INFO] Web defaults = org/mortbay/jetty/webapp/webdefault.xml > [INFO] Web overrides = none > [INFO] Webapp directory = > /Users/jonwilliams/wrk/java/3rdParty/tapestry-cometd-demo-master/src/main/webapp > [INFO] Starting jetty 6.1.16 ... > 2013-05-22 18:02:35.211::INFO: jetty-6.1.16 > 2013-05-22 18:02:35.327::INFO: No Transaction manager found - if your > webapp requires one, please configure one. > [INFO] ioc.RegistryBuilder Adding module definition for class > org.apache.tapestry5.ioc.services.TapestryIOCModule > [INFO] ioc.RegistryBuilder Adding module definition for class > org.apache.tapestry5.json.services.JSONModule > [INFO] ioc.RegistryBuilder Adding module definition for class > org.lazan.t5.cometd.services.CometdModule > [INFO] ioc.RegistryBuilder Adding module definition for class > org.got5.tapestry5.jquery.services.JQueryModule > [INFO] ioc.RegistryBuilder Adding module definition for class > org.got5.tapestry5.jquery.services.js.JSModule > [INFO] ioc.RegistryBuilder Adding module definition for class > org.apache.tapestry5.upload.services.UploadModule > [INFO] ioc.RegistryBuilder Adding module definition for class > org.apache.tapestry5.services.TapestryModule > [INFO] ioc.RegistryBuilder Adding module definition for class > org.apache.tapestry5.internal.services.InternalModule > [INFO] ioc.RegistryBuilder Adding module definition for class > org.apache.tapestry5.services.assets.AssetsModule > [INFO] ioc.RegistryBuilder Adding module definition for class > org.apache.tapestry5.services.pageload
Re: dwr java chat demo in t5
Hi Lance, This email thread caught my eye so I went and got your example app. It seems to be running, in a fashion. However, I'm seeing NPE's at runtime... 1 caveat, maybe pertinent. I had to add a dependency to the pom to get a good build... org.eclipse.jetty jetty-server 7.6.4.v20120524 If you've got a moment, maybe you could take a look. Quite interested in using your project. thanks Jon Here my console output... /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Dmaven.home=/usr/share/java/maven-3.0.4 -Dclassworlds.conf=/usr/share/java/maven-3.0.4/bin/m2.conf -Didea.launcher.port=7532 "-Didea.launcher.bin.path=/Applications/jetbrains2013/IntelliJ IDEA 12.app/bin" -Dfile.encoding=UTF-8 -classpath "/usr/share/java/maven-3.0.4/boot/plexus-classworlds-2.4.jar:/Applications/jetbrains2013/IntelliJ IDEA 12.app/lib/idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher --fail-fast --strict-checksums org.mortbay.jetty:maven-jetty-plugin:6.1.16:run -P jetty-hightide [INFO] Scanning for projects... [INFO] [INFO] [INFO] Building tapestry-cometd-demo Tapestry 5 Application 1.0-SNAPSHOT [INFO] [INFO] [INFO] >>> maven-jetty-plugin:6.1.16:run (default-cli) @ tapestry-cometd-demo >>> [INFO] [INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ tapestry-cometd-demo --- [debug] execute contextualize [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] Copying 8 resources [INFO] [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ tapestry-cometd-demo --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ tapestry-cometd-demo --- [debug] execute contextualize [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] Copying 1 resource [INFO] [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ tapestry-cometd-demo --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] <<< maven-jetty-plugin:6.1.16:run (default-cli) @ tapestry-cometd-demo <<< [INFO] [INFO] --- maven-jetty-plugin:6.1.16:run (default-cli) @ tapestry-cometd-demo --- [INFO] Configuring Jetty for project: tapestry-cometd-demo Tapestry 5 Application [INFO] Webapp source directory = /Users/jonwilliams/wrk/java/3rdParty/tapestry-cometd-demo-master/src/main/webapp [INFO] Reload Mechanic: automatic [INFO] web.xml file = /Users/jonwilliams/wrk/java/3rdParty/tapestry-cometd-demo-master/src/main/webapp/WEB-INF/web.xml [INFO] Classes = /Users/jonwilliams/wrk/java/3rdParty/tapestry-cometd-demo-master/target/classes 2013-05-22 18:02:35.124::INFO: Logging to STDERR via org.mortbay.log.StdErrLog [INFO] Context path = /tapestry-cometd-demo [INFO] Tmp directory = determined at runtime [INFO] Web defaults = org/mortbay/jetty/webapp/webdefault.xml [INFO] Web overrides = none [INFO] Webapp directory = /Users/jonwilliams/wrk/java/3rdParty/tapestry-cometd-demo-master/src/main/webapp [INFO] Starting jetty 6.1.16 ... 2013-05-22 18:02:35.211::INFO: jetty-6.1.16 2013-05-22 18:02:35.327::INFO: No Transaction manager found - if your webapp requires one, please configure one. [INFO] ioc.RegistryBuilder Adding module definition for class org.apache.tapestry5.ioc.services.TapestryIOCModule [INFO] ioc.RegistryBuilder Adding module definition for class org.apache.tapestry5.json.services.JSONModule [INFO] ioc.RegistryBuilder Adding module definition for class org.lazan.t5.cometd.services.CometdModule [INFO] ioc.RegistryBuilder Adding module definition for class org.got5.tapestry5.jquery.services.JQueryModule [INFO] ioc.RegistryBuilder Adding module definition for class org.got5.tapestry5.jquery.services.js.JSModule [INFO] ioc.RegistryBuilder Adding module definition for class org.apache.tapestry5.upload.services.UploadModule [INFO] ioc.RegistryBuilder Adding module definition for class org.apache.tapestry5.services.TapestryModule [INFO] ioc.RegistryBuilder Adding module definition for class org.apache.tapestry5.internal.services.InternalModule [INFO] ioc.RegistryBuilder Adding module definition for class org.apache.tapestry5.services.assets.AssetsModule [INFO] ioc.RegistryBuilder Adding module definition for class org.apache.tapestry5.services.pageload.PageLoadModule [INFO] ioc.RegistryBuilder Adding module definition for class org.lazan.t5.cometddemo.services.AppModule [INFO] TapestryModule.ComponentClassResolver Registering cometd component library [INFO] TapestryModule.ComponentClassResolver Available pages (8): (blank): org.lazan.t5.cometddemo.pages.Index Chat: org.lazan.t5.cometddemo.pages.Chat Excepti
Re: dwr java chat demo in t5
Hi, as a previous dwr committer myself, I was keen to provide dwr reverse ajax / tapestry integration. After speaking to the dwr team, I found that the push mechanism in dwr was not considered bulletproof and was directed towards cometd For this reason, I have created tapestry-cometd, a push library for tapestry that requires zero javascript https://github.com/uklance/tapestry-cometd You must be aware that the tapestry team currently have push as a high priority feature for the next release. So watch this space for an out of the box solution. In the meantime, I'll be happy to help with a tapestry - cometd solution .
dwr java chat demo in t5
Hi @all, i was suprised that t5 does not support reverse ajax ;-( googleing around, the only thing mentioned often enough is dwr and i ended here: http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/Implement-chat-function-td5606481.html Actually, i want to do the same thing as the threadstarter: A loggedin user can start a one-to-one chat with an admin. The admin can handle multiple chats at the same time... I don't really know if dwr is what i really want and if dwr is the best thing recommended? Or are better solutions out there? So i've tried to integrate the Java Chat with the latest dwr-RC3 from dwr first, but only with partial success. My implementation does not have the same behaviour like the demo: http://directwebremoting.org/dwr-demo/reverseajax/java-chat.html I've put the HTML source (i had to replace the div with an ul) and the Javascript source into a .tml and the Java source into a corresponding java class into my t5 jumpstart project. GOOD: i can see the clients polling: ... [INFO] log.accessLog Incoming request: /dwr/call/plainpoll/ReverseAjax.dwr [INFO] log.accessLog Incoming request: /dwr/call/plainpoll/ReverseAjax.dwr [INFO] log.accessLog Incoming request: /dwr/call/plainpoll/ReverseAjax.dwr [INFO] log.accessLog Incoming request: /dwr/call/plainpoll/ReverseAjax.dwr ... GOOD: the addMessage() Method is called when the button is pressed ok, this is default behaviour GOOD: with opera i first get the expected behaviour: open page in opera and firefox, type "opera1" in opera and the message will be displayed in firefox and opera correctly. NOT GOOD: Then i type an "opera2" in opera and in opera i see the correct output: opera2 opera1 But in firefox, the first message did not disapear, i get: opera1 opera2 opera1 BAD: now i type "firefox" in firefox and i get in opera: opera2 opera1 firefox opera2 opera1 In the firefox browser nothing happens... the textfield is not reset and i still have: opera1 opera2 opera1 BAD: when i now type an "opera3" in opera, i get in opera: opera3 firefox opera2 opera1 initially what i did really expected, but before was the wrong output, which is now replaced with the correct output :-) In firefox still everythig is wrong: opera1 opera2 opera1 opera3 firefox opera2 opera1 VERY BAD: i get a lot of: 2013-05-22 22:28:47.976:WARN::header full: java.lang.NullPointerException and: 2013-05-22 22:28:47.976:WARN::header full: java.lang.IllegalStateException: last? and i don't know anything about these message, from where they come and what they mean and how i can trace them Also with chrome i am facing similar issues to firefox. I know the most questions will come, when i want to access tapestryservices later, but when i get these strange behaviour i don't know if dwr is the right thing when i don't get this simple example running. The thing is that i don't really know what the clients are calling. They call the dwr-servlet via the generated .js: "return dwr.engine._execute(p._path, 'MyChat', 'addMessage', arguments);" but how does dwr response? In the end i must access a t5 service, so the response must be filled with data from the t5 service... At this point i can not imagine how i can encapsulate dwr with t5 and let dwr interact with t5. Informations and examples are more than rare :-( A reverse ajax chat-webapp is not the most extreme case i can imagine :-) Anybody out there with some suggestions? Kind regards David - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org