views:

564

answers:

3

hi,

  1. i am refering to this tutorial http://www.jroller.com/masini/entry/a_comet_implementation_for_google . is it a must to configure tomcat when using comet?
  2. can gwt+comet run on hosted mode or required -noserver?
+1  A: 
  1. Using the library you need only to configure the web.xml (and add the jar to the tomcat libs) as described in the article you mention.
  2. Yes it can run in hosted mode, without -noserver. However, since GWT 1.6 the default engine is Jetty, (the legacy tomcat is still supported). If you are using the hosted mode tomcat version, you need to add the configuration to the web.xml in the generated tomcat directory in your project folder and add the library jar to the directory as well.

You might want to look into another library GWTEventService http://code.google.com/p/gwteventservice/, that is more up to date and has also more details about how to use it.

The GWTEventService project also has a description on how to deploy to tomcat, which should be similar to the library from the article: http://code.google.com/p/gwteventservice/wiki/Deployment.

Hilbrand
+1  A: 

I would recommend using this GWT Comet Adapter it doesn't require tomcat and runs in hosted and compiled mode.

To quote:

Because of the way StreamHub and GWT interact, you will need to add the following to your GWT module file (the .gwt.xml file) when running in compiled mode:

  <!-- Cross-site linker needed for compiling to web mode -->
  <!-- Remove during development in hosted mode  -->
  <add-linker name="xs" />

You must comment this line out when working in hosted mode.

Corehpf
+1  A: 

If you don't specially configure tomcat, you will run out of open connections to handle requests.

While there are a number of GWT libraries for Comet-style requests, writing your own isn't that hard. Specifically, building something with the Atmosphere API is advantageous since it uses the built in Comet support libraries in all the major servlet engines now. Barring a formal specification for JEE, it is definitely the way to go.

kebernet