tags:

views:

173

answers:

3

I love the idea of Grizzly, but I can't find any good examples to work with. Well, any good tutorial... I want to have an embedded HTTP server that I can talk to from Dojo. I don't want a J2EE server and I want to use Java. What do you folks think?

+1  A: 

Java6 has a simple embedded http server.

http://java.sun.com/javase/6/docs/jre/api/net/httpserver/spec/index.html

Wayne Young
True, but Grizzly provides features that http server doesn't.
Paul
What feature do you need that is missing?
Wayne Young
Sorry, that is my natural work reaction. I sometimes think no one knows HttpServer exists, so I like to point it out. Good luck to you.
Wayne Young
+1  A: 

Jetty has support for asynch servlet continuations and comet-style programming. See the documentation index. It can also be easily run embedded within another java application

skaffman
+2  A: 

StreamHub Push Server is a Comet server written in Java. you can use it as a JAR to embed it in your stack. It also works as a simple HTTP server. It's not integrated with dojo.io but there are plenty of good examples using a simple javascript library.

var hub = new StreamHub();
hub.connect("http://localhost:7979/");
hub.subscribe("MyTopic", function(topic, json) {
    alert("got update on topic: " + topic + " MyField=" + json['MyField']);
});
// ...

Oh, and for a good tutorial try Getting Started with StreamHub and Comet.

Supertux