This closes #91
diff --git a/examples/webapps/hello-world-sql/pom.xml b/examples/webapps/hello-world-sql/pom.xml
index c55d0c7..fdd9189 100644
--- a/examples/webapps/hello-world-sql/pom.xml
+++ b/examples/webapps/hello-world-sql/pom.xml
@@ -101,6 +101,11 @@
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>redis.clients</groupId>
+ <artifactId>jedis</artifactId>
+ <version>${redis.version}</version>
+ </dependency>
</dependencies>
<build>
diff --git a/examples/webapps/hello-world-sql/src/main/webapp/available.jsp b/examples/webapps/hello-world-sql/src/main/webapp/available.jsp
index ddb4bf4..443e302 100644
--- a/examples/webapps/hello-world-sql/src/main/webapp/available.jsp
+++ b/examples/webapps/hello-world-sql/src/main/webapp/available.jsp
@@ -41,12 +41,19 @@
<ul>
<%
-String url=System.getProperty("brooklyn.example.db.url");
+String mySqlUrl=System.getProperty("brooklyn.example.db.url");
//URL should be supplied e.g. "-Dbrooklyn.example.db.url=jdbc:mysql://localhost/visitors?user=brooklyn&password=br00k11n"
//(note quoting needed due to ampersand)
-if (url!=null) {
+if (mySqlUrl!=null) {
%>
<li><a href="db.jsp">SQL database chatroom</a></li>
+<% }
+
+String redisUrl=System.getProperty("brooklyn.example.redis.host");
+//Host should be supplied e.g. "-Dbrooklyn.example.redis.host=localhost"
+if (redisUrl!=null) {
+%>
+<li><a href="redis.jsp">Redis chatroom</a></li>
<% } %>
<%
@@ -71,9 +78,9 @@
%>
<li><a href="riak.jsp">Riak chatroom</a></li>
<% }
-if (hadoop==null && url==null && mongo==null && riak==null) {
+if (hadoop==null && mySqlUrl==null && mongo==null && riak==null && redisUrl==null) {
%>
-<li><i>None.</i> Try one of the other Brooklyn examples to see SQL or Hadoop.</li>
+<li><i>None.</i> Try one of the other Brooklyn examples to see SQL, Hadoop or Redis</li>
<% } %>
</ul>
diff --git a/examples/webapps/hello-world-sql/src/main/webapp/redis.jsp b/examples/webapps/hello-world-sql/src/main/webapp/redis.jsp
new file mode 100644
index 0000000..7082fc3
--- /dev/null
+++ b/examples/webapps/hello-world-sql/src/main/webapp/redis.jsp
@@ -0,0 +1,77 @@
+<%@ page import="java.util.List" %>
+<%@ page import="redis.clients.jedis.Jedis" %>
+
+<html>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<head>
+ <title>Sample Application Database JSP Page</title>
+</head>
+<br/>
+<body bgcolor=white>
+
+<table border="0">
+ <tr>
+ <td align=center>
+ <img src="images/bridge-small.png">
+ </td>
+ <td>
+ <h1>Sample Brooklyn Deployed WebApp (Database JSP)</h1>
+ This is the output of a JSP page that is part of the Hello, World application,
+ deployed by Brooklyn, to show <b>Redis database interactivity</b>.
+ </td>
+ </tr>
+</table>
+<br/>
+<p>Visitors:</p>
+<ul>
+<%
+ String redisUrl=System.getProperty("brooklyn.example.redis.host");
+ Jedis jedis = new Jedis(redisUrl);
+
+ if (request.getParameter("name")!=null) {
+ jedis.lpush("messages", request.getParameter("name")+":"+request.getParameter("message"));
+ }
+
+ List<String> messages = jedis.lrange("messages", 0, 10);
+ for (int i =0; i < messages.size(); i++){
+ String[] messageParts = messages.get(i).split(":");
+ String name = messageParts[0];
+ String message = messageParts[1];
+ %>
+ <li> <b><%= name %></b>: <%= message %> </li>
+ <% } %>
+</ul>
+
+<br/>
+
+<p>Please enter a message:</p>
+
+<form action="redis.jsp" method="GET">
+ <table>
+ <tr><td>Name: </td><td><input type="text" name="name"></td></tr>
+ <tr><td>Message: </td><td><input type="text" name="message"></td></tr>
+ </table>
+ <input type="submit" value="Submit"/>
+</form>
+
+<br/>
+<p>Click <a href="index.html">here</a> to go back to the main page.</p>
+</body>
+</html>