Skip to content

Commit

Permalink
a few tweaks and corrections before beta3
Browse files Browse the repository at this point in the history
  • Loading branch information
purplefox committed Mar 13, 2012
1 parent 645af98 commit 7982978
Show file tree
Hide file tree
Showing 33 changed files with 30 additions and 229 deletions.
4 changes: 1 addition & 3 deletions src/examples/groovy/websockets/ws.html
Expand Up @@ -18,8 +18,6 @@
*
-->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Web Socket Demonstration</title>
Expand All @@ -39,7 +37,7 @@
</form>
<h2 id ="foo">
</h2>
<script type="text/javascript">
<script>
var foo = document.getElementById('foo');
var socket;
if (window.WebSocket) {
Expand Down
2 changes: 1 addition & 1 deletion src/examples/java/build.xml
Expand Up @@ -23,7 +23,7 @@
<property name="src" value="."/>
<property name="output" value="classes"/>
<property name="libs" value="../../../lib/main"/>
<property name="vertx-classes" value="../../../target/core/classes"/>
<property name="vertx-classes" value="../../../target/java/classes"/>

<property name="quux-output" value="quux-out"/>

Expand Down
4 changes: 2 additions & 2 deletions src/examples/java/eventbusbridge/index.html
Expand Up @@ -3,7 +3,7 @@
<html>
<head>
<title></title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="http://cdn.sockjs.org/sockjs-0.2.1.min.js"></script>
<script src="vertxbus.js"></script>
</head>
Expand Down Expand Up @@ -76,7 +76,7 @@
<div id="status_info">Not connected</div>
</div>

<script type="text/javascript">
<script>

var eb = null;

Expand Down
58 changes: 0 additions & 58 deletions src/examples/java/org/vertx/java/examples/eventbus/Receiver.java

This file was deleted.

78 changes: 0 additions & 78 deletions src/examples/java/org/vertx/java/examples/eventbus/Sender.java

This file was deleted.

Expand Up @@ -21,10 +21,6 @@ public class BridgeServer implements Verticle {
public void start() throws Exception {
server = new HttpServer();

List<JsonObject> permitted = new ArrayList<>();
permitted.add(new JsonObject()); // Let everything through
new SockJSBridge(server, new AppConfig().setPrefix("/eventbus"), permitted);

// Also serve the static resources. In real life this would probably be done by a CDN
server.requestHandler(new Handler<HttpServerRequest>() {
public void handle(HttpServerRequest req) {
Expand All @@ -33,6 +29,10 @@ public void handle(HttpServerRequest req) {
}
});

List<JsonObject> permitted = new ArrayList<>();
permitted.add(new JsonObject()); // Let everything through
new SockJSBridge(server, new AppConfig().setPrefix("/eventbus"), permitted);

server.listen(8080);
}

Expand Down
Expand Up @@ -32,6 +32,12 @@ public class SockJSExample implements Verticle {
public void start() {
server = new HttpServer();

server.requestHandler(new Handler<HttpServerRequest>() {
public void handle(HttpServerRequest req) {
if (req.path.equals("/")) req.response.sendFile("sockjs/index.html"); // Serve the html
}
});

SockJSServer sockServer = new SockJSServer(server);

sockServer.installApp(new AppConfig().setPrefix("/testapp"), new Handler<SockJSSocket>() {
Expand All @@ -44,12 +50,7 @@ public void handle(Buffer data) {
}
});

server.requestHandler(new Handler<HttpServerRequest>() {
public void handle(HttpServerRequest req) {
if (req.path.equals("/")) req.response.sendFile("sockjs/index.html"); // Serve the html
}
}).listen(8080);

server.listen(8080);
}

public void stop() {
Expand Down
2 changes: 0 additions & 2 deletions src/examples/java/route_match/index.html
@@ -1,5 +1,3 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><title>Route Matcher example</title></head>
<body>
Expand Down
2 changes: 0 additions & 2 deletions src/examples/java/sendfile/index.html
Expand Up @@ -14,8 +14,6 @@
~ limitations under the License.
-->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>vert.x static web server</title>
Expand Down
2 changes: 0 additions & 2 deletions src/examples/java/sendfile/page1.html
Expand Up @@ -14,8 +14,6 @@
~ limitations under the License.
-->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
Expand Down
2 changes: 0 additions & 2 deletions src/examples/java/sendfile/page2.html
Expand Up @@ -14,8 +14,6 @@
~ limitations under the License.
-->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
Expand Down
6 changes: 2 additions & 4 deletions src/examples/java/sockjs/index.html
Expand Up @@ -18,16 +18,14 @@
*
-->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>SockJS Test</title>
<script src="http://cdn.sockjs.org/sockjs-0.2.1.min.js"></script>
</head>
<body>

<script type="text/javascript">
<script>
var sock = new SockJS('http://localhost:8080/testapp');
sock.onopen = function() {
console.log('open');
Expand All @@ -46,7 +44,7 @@
console.log("sending message")
sock.send(message);
} else {
sock("The socket is not open.");
console.log("The socket is not open.");
}
}
</script>
Expand Down
4 changes: 1 addition & 3 deletions src/examples/java/websockets/ws.html
Expand Up @@ -18,12 +18,10 @@
*
-->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><title>Web Socket Test</title></head>
<body>
<script type="text/javascript">
<script>
var socket;
if (window.WebSocket) {
socket = new WebSocket("ws://localhost:8080/myapp");
Expand Down
2 changes: 1 addition & 1 deletion src/examples/javascript/README.md
Expand Up @@ -13,7 +13,7 @@ you can run vertx is application server mode. See the wiki for more information)

(for full help on deploying just type vertx from the command line)

(from this directory)
(all examples should be run from this directory unless otherwise stated (e.g. the webapp example))

vertx run <example script name>

Expand Down
4 changes: 1 addition & 3 deletions src/examples/javascript/eventbusbridge/index.html
@@ -1,5 +1,3 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
Expand Down Expand Up @@ -76,7 +74,7 @@
<div id="status_info">Not connected</div>
</div>

<script type="text/javascript">
<script>

var eb = null;

Expand Down
2 changes: 0 additions & 2 deletions src/examples/javascript/route_match/index.html
@@ -1,5 +1,3 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><title>Route Matcher example</title></head>
<body>
Expand Down
7 changes: 0 additions & 7 deletions src/examples/javascript/scratch/scratch.js

This file was deleted.

2 changes: 0 additions & 2 deletions src/examples/javascript/sendfile/index.html
Expand Up @@ -14,8 +14,6 @@
~ limitations under the License.
-->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>vert.x static web server</title>
Expand Down
2 changes: 0 additions & 2 deletions src/examples/javascript/sendfile/page1.html
Expand Up @@ -14,8 +14,6 @@
~ limitations under the License.
-->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
Expand Down
2 changes: 0 additions & 2 deletions src/examples/javascript/sendfile/page2.html
Expand Up @@ -14,8 +14,6 @@
~ limitations under the License.
-->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
Expand Down
6 changes: 2 additions & 4 deletions src/examples/javascript/sockjs/index.html
Expand Up @@ -14,16 +14,14 @@
~ limitations under the License.
-->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>SockJS Test</title>
<script src="http://cdn.sockjs.org/sockjs-0.2.1.min.js"></script>
</head>
<body>

<script type="text/javascript">
<script>
var sock = new SockJS('http://localhost:8080/testapp');
sock.onopen = function() {
console.log('open');
Expand All @@ -42,7 +40,7 @@
console.log("sending message")
sock.send(message);
} else {
sock("The socket is not open.");
console.log("The socket is not open.");
}
}
</script>
Expand Down

0 comments on commit 7982978

Please sign in to comment.