You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by justinThompson <gi...@git.apache.org> on 2017/02/07 12:36:14 UTC
[GitHub] brooklyn-library pull request #91: Updated "hello-world-sql" example webapp ...
GitHub user justinThompson opened a pull request:
https://github.com/apache/brooklyn-library/pull/91
Updated "hello-world-sql" example webapp to support Redis
### Added Redis integration into hello-world-sql example webapp
- added Jedis dependency
- updated `available.jsp` to optionally display link to `Redis.jsp`
- added a page for the Redis chatroom
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/justinThompson/brooklyn-library hello-world-sql-redis-webapp
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/brooklyn-library/pull/91.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #91
----
commit 8540bab993029c9b667ef8121e29dde8ad3dc999
Author: Justin Thompson <ju...@cloudsoftcorp.com>
Date: 2017-02-07T12:33:30Z
* Added Redis integration into hello-world-sql example*
- added Jedis dependency
- updated available.jsp to optionally display Redis link
- added a jsp for the Redis chatroom
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] brooklyn-library pull request #91: Updated "hello-world-sql" example webapp ...
Posted by sjcorbett <gi...@git.apache.org>.
Github user sjcorbett commented on a diff in the pull request:
https://github.com/apache/brooklyn-library/pull/91#discussion_r102722987
--- Diff: examples/webapps/hello-world-sql/src/main/webapp/redis.jsp ---
@@ -0,0 +1,80 @@
+<%@ 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>.
--- End diff --
Capitalise Brooklyn
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] brooklyn-library issue #91: Updated "hello-world-sql" example webapp to supp...
Posted by sjcorbett <gi...@git.apache.org>.
Github user sjcorbett commented on the issue:
https://github.com/apache/brooklyn-library/pull/91
@justinThompson looks good thanks. I've left a couple of minor comments. Will test the feature out before merging.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] brooklyn-library pull request #91: Updated "hello-world-sql" example webapp ...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/brooklyn-library/pull/91
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] brooklyn-library pull request #91: Updated "hello-world-sql" example webapp ...
Posted by sjcorbett <gi...@git.apache.org>.
Github user sjcorbett commented on a diff in the pull request:
https://github.com/apache/brooklyn-library/pull/91#discussion_r102723143
--- Diff: examples/webapps/hello-world-sql/src/main/webapp/redis.jsp ---
@@ -0,0 +1,80 @@
+<%@ 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>
+ <%
+ }
+%>
--- End diff --
nitpick: collapse the three lines above into one: `<% } %>`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---