Discussion:
HTTP Persistent Connection in Jetty
Gator Bait
2011-08-15 00:45:59 UTC
Permalink
Hi,

I'm new to GWT.

I'm using GWT 2.3 and the embedded Jetty server instance(not sure what
version of Jetty).

Will someone point me to an example of how Jetty should be configured
to support persistent HTTP connections? From my reading, don't think
there is a jetty.xml file to configure. Should Jetty be set up from
com.google.gwt.dev.shell.jetty.JettyLauncher class? If so, could you
provide an example?

Thanks for your time!

Gator Bait
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Kevin Jordan
2011-08-15 14:22:02 UTC
Permalink
Are you referring to Comet and/or Websockets? For both of those, it's
part of the servlet you're connecting to. Websockets will require a
Jetty 7 version though.
Post by Gator Bait
Hi,
I'm new to GWT.
I'm using GWT 2.3 and the embedded Jetty server instance(not sure what
version of Jetty).
Will someone point me to an example of how Jetty should be configured
to support persistent HTTP connections?  From my reading, don't think
there is a jetty.xml file to configure.  Should Jetty be set up from
com.google.gwt.dev.shell.jetty.JettyLauncher class?  If so, could you
provide an example?
Thanks for your time!
Gator Bait
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Gator Bait
2011-08-15 15:21:16 UTC
Permalink
Hi Kevin,

Thanks for the reply.

Didn't think Comet was a good choice because of issues regarding
second level domains and cross-site scripting vulnerabilities:

http://en.wikipedia.org/wiki/Comet_%28programming%29

Not familiar with Websockets.

What I want to do is this: have my servlet push data to my user
interface widget reusing the HTTP connection. Not sure what version
of Jetty is used in GWT 2.3 (ultimate goal is to deploy on Tomcat 6,
but, wanted to get something working in the hosted environment
first).
From your response, sounds like this is controlled from the servlet
code and not Jetty.
Will you point me to an example?

Many thanks,
Gator Bait
Are you referring to Comet and/or Websockets?  For both of those, it's
part of the servlet you're connecting to.  Websockets will require aJetty7 version though.
Post by Gator Bait
Hi,
I'm new to GWT.
I'm using GWT 2.3 and the embeddedJettyserver instance(not sure what
version ofJetty).
Will someone point me to an example of howJettyshould be configured
to support persistentHTTPconnections?  From my reading, don't think
there is ajetty.xml file to configure.  ShouldJettybe set up from
com.google.gwt.dev.shell.jetty.JettyLauncher class?  If so, could you
provide an example?
Thanks for your time!
Gator Bait
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Kevin Jordan
2011-08-16 02:33:32 UTC
Permalink
Well, Comet is a pretty broad term that includes what you want.
Although you can't keep a connection alive forever, unless you use the
hidden iframe technique from your wikipedia link, which is where the
vulnerability comes in. At the moment, you can use Jetty
Continuations or Servlet 3 to achieve long polling through request
suspending.

Via continuations:
final Continuation continuation =
ContinuationSupport.getContinuation(request);
continuation.setTimeout(35000);
continuation.suspend(response);
//Do processing
continuation.resume();

See more at: http://download.eclipse.org/jetty/stable-7/apidocs/org/eclipse/jetty/continuation/Continuation.html

Servlet 3 has a similar API, you suspend and resume or complete the
request:
http://www.jarvana.com/jarvana/view/org/mortbay/jetty/servlet-api/3.0.pre1/servlet-api-3.0.pre1-javadoc.jar!/javax/servlet/ServletRequest.html
Post by Gator Bait
Hi Kevin,
Thanks for the reply.
Didn't think Comet was a good choice because of issues regarding
http://en.wikipedia.org/wiki/Comet_%28programming%29
Not familiar with Websockets.
What I want to do is this: have my servlet push data to my user
interface widget reusing the HTTP connection.  Not sure what version
of Jetty is used in GWT 2.3 (ultimate goal is to deploy on Tomcat 6,
but, wanted to get something working in the hosted environment
first).
From your response, sounds like this is controlled from the servlet
code and not Jetty.
Will you point me to an example?
Many thanks,
Gator Bait
Are you referring to Comet and/or Websockets?  For both of those, it's
part of the servlet you're connecting to.  Websockets will require aJetty7 version though.
Post by Gator Bait
Hi,
I'm new to GWT.
I'm using GWT 2.3 and the embeddedJettyserver instance(not sure what
version ofJetty).
Will someone point me to an example of howJettyshould be configured
to support persistentHTTPconnections?  From my reading, don't think
there is ajetty.xml file to configure.  ShouldJettybe set up from
com.google.gwt.dev.shell.jetty.JettyLauncher class?  If so, could you
provide an example?
Thanks for your time!
Gator Bait
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Loading...