You can also use the Atmosphere framework:

https://atmosphere.dev.java.net/

If you use it with their jQuery plugin, you can easily get WebSocket support 
for clients that support it, with a fallback to Comet streaming for clients 
that don't.

It can be a little bit of a pain to set up for the first time--the website 
is unfortunately lacking in a set of server-by-server instructions--but once 
it's set up it's usually pretty easy to use.

-allen


On Fri, Dec 10, 2010, 15:38, Daniil Sosonkin <[email protected]> wrote
>This is pretty nifty.
>Although I can't figure out yet how to make it work under tomcat. We're 
using tomcat so Jetty's solution below won't work for me. jWebSocket sounds 
like a perfect solution for me because it automatically falls back to Flash 
bridge in case WebSockets aren't available. But I don't want to run it on a 
whole different server/port since my whole web app is written on Stripes.
>Once I figure out how to create an ActionBean I'll send it here or if 
someone else figures it out before me, please send it here too.
>Daniil
>On 12/9/2010 7:59 PM, samuel baudouin wrote:
>Hi all,
>Just my 2 cents : a quick search on google gave me this : 
http://jwebsocket.org/
>It appears to be a complete webSocket Framework (both java and js) that is 
independant from the container.
>Combined with your solution, that could be a pretty and nice solution for 
supporting webSocket on any container/application server....
>I haven't tested it, but examples seems pretty straight forward.
>Regards,
>Sam
>On Fri, Dec 10, 2010 at 3:21 AM, Sven Jacobs < [email protected] > wrote:
>Hi,
>I've looked at the source code of the WebSocketServlet of Jetty to find out 
how they initialize WebSockets and was able to "port" some code over to a 
Stripes Resolution. It works! :-)
>However this code still depends on the Jetty server and most of the 
WebSockets stuff is done in the Jetty library but that's okay for me since I 
plan to run this app in Jetty only.
>Here's the code, if you're interested: http://pastebin.com/PfBQp7be It's 
not beautiful, just a quick hack! ;-)
>Regards,
>Sven
>2010/12/9 farouk alhassan < [email protected] >
>Hi
>If you know how the bare bones websockets framework and you understand the 
details of the communication protocol, You could easily create a Custom 
Resolution and return those in your action beans. Creating your own 
resolution is a no brainer. Just check out the source for the 
ForwardResolution class and you will have enough to get started
>hope this helps
>regards
>--- On Thu, 9/12/10, Sven Jacobs < [email protected] > wrote:
>From: Sven Jacobs < [email protected] >
>Subject: Re: [Stripes-users] Stripes and WebSockets?
>To: "Stripes Users List" < [email protected] >
>Date: Thursday, 9 December, 2010, 16:07
>Hi Tim,
>thanks for your reply!
>I'm well aware that Jetty is a servlet container and not a web framework 
like Stripes ;-) Maybe my question wasn't clear enough. Sorry for that!
>Let's rephrase it: How would I develop an application with Stripes that 
uses WebSockets (and runs on Jetty)?
>Since Ajax is natively supported by Stripes I was hoping that it's almost 
equally easy to use WebSockets. I'm focusing on Jetty because it's one of 
the few servlet containers that already support WebSockets. However you have 
to create a servlet that extends from WebSocketServlet. That way I can't use 
the Stripes servlet and all the code in the WebSocketServlet runs "besides" 
and not within the Stripes framework.
>So you are saying that I should implement the WebSockets protocol within 
Stripes?
>Regards,
>Sven
>2010/12/9 Stone, Timothy < [email protected] >
>Sven,
>Jetty is a servlet container, e.g., Tomcat. Jetty?s support of WebSockets, 
the HTML5 feature, is unrelated to Stripes.
>The question you may want an answer to is what Stripes Resolution might 
best support the creation and use of WebSockets, see 
http://en.wikipedia.org/wiki/WebSockets for the protocol implementation.
>I don?t see anything that could not be implemented in Stripes, possibly 
with a Streaming or JavaScript Resolution. There?s some token encryption 
that the server should be able to handle or pass off to the Action that 
might be an exercise implementation or library support.
>If there is a JSP example of WebSockets on the web, it should be ?portable? 
to the Stripes platform it your favorite container (Jetty, Tomcat, WebLogic, 
Jboss, etc.).
>Regards,
>Tim
>On 12/9/10 8:57 AM, "Sven Jacobs" < [email protected] > wrote:
>Hi all,
>I was wondering if anyone has already used WebSockets along with Stripes? 
Jetty 7 supports WebSockets, for example.
>I'm new to Stripes. What would be the recommended way to use WebSockets in 
Stripes?
>Many thanks,
>Sven
>---------------------------------------------------------------------------
---
>This SF Dev2Dev email is sponsored by:
>WikiLeaks The End of the Free Internet
>http://p.sf.net/sfu/therealnews-com
>--
>Timothy Stone | Director, Application Developer Technical Lead
>Barclaycard | Business Technology Group, Solutions Delivery
>125 S. West Street | Wilmington, DE | 19801
>USA | www.barclaycardus.com
>+1 302 255 8044 direct | +1 410 441 9450 cell
>COMPANY CONFIDENTIAL
>P Before printing this e-mail, or any other document, ask yourself whether 
you need a hard copy
>_______________________________________________________
>Barclays
>www.barclaycardus.com
>_______________________________________________________
>This e-mail and any files transmitted with it may contain confidential 
and/or proprietary information. It is intended solely for the use of the 
individual or entity who is the intended recipient. Unauthorized use of this 
information is prohibited. If you have received this in error, please 
contact the sender by replying to this message and delete this material from 
any system it may be on.
>---------------------------------------------------------------------------
---
>This SF Dev2Dev email is sponsored by:
>WikiLeaks The End of the Free Internet
>http://p.sf.net/sfu/therealnews-com
>_______________________________________________
>Stripes-users mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/stripes-users
>-----Inline Attachment Follows-----
>---------------------------------------------------------------------------
---
>-----Inline Attachment Follows-----
>_______________________________________________
>Stripes-users mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/stripes-users
>---------------------------------------------------------------------------
---
>_______________________________________________
>Stripes-users mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/stripes-users
>---------------------------------------------------------------------------
---
>_______________________________________________
>Stripes-users mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/stripes-users
>--
>Samuel Baudouin
>
>
>---------------------------------------------------------------------------
---
>
>
>_______________________________________________
>Stripes-users mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/stripes-users
>


------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages, 
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev 
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to