Creating template

This commit is contained in:
Template builder
2013-07-10 06:01:18 -04:00
commit e5f9c9d617
24 changed files with 1179 additions and 0 deletions

0
src/main/java/.gitkeep Executable file
View File

0
src/main/resources/.gitkeep Executable file
View File

19
src/main/webapp/WEB-INF/web.xml Executable file
View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
metadata-complete="false">
<servlet>
<servlet-name>health</servlet-name>
<jsp-file>/health.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>health</servlet-name>
<url-pattern>/health</url-pattern>
</servlet-mapping>
</web-app>

1
src/main/webapp/health.jsp Executable file
View File

@@ -0,0 +1 @@
1

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

182
src/main/webapp/index.html Executable file
View File

@@ -0,0 +1,182 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Welcome to OpenShift</title>
<style>
html {
background: black;
}
body {
background: #333;
background: -webkit-linear-gradient(top, black, #666);
background: -o-linear-gradient(top, black, #666);
background: -moz-linear-gradient(top, black, #666);
background: linear-gradient(top, black, #666);
color: white;
font-family: "Helvetica Neue",Helvetica,"Liberation Sans",Arial,sans-serif;
width: 40em;
margin: 0 auto;
padding: 3em;
}
a {
color: white;
}
h1 {
text-transform: capitalize;
-moz-text-shadow: -1px -1px 0 black;
-webkit-text-shadow: 2px 2px 2px black;
text-shadow: -1px -1px 0 black;
box-shadow: 1px 2px 2px rgba(0, 0, 0, 0.5);
background: #CC0000;
width: 22.5em;
margin: 1em -2em;
padding: .3em 0 .3em 1.5em;
position: relative;
}
h1:before {
content: '';
width: 0;
height: 0;
border: .5em solid #91010B;
border-left-color: transparent;
border-bottom-color: transparent;
position: absolute;
bottom: -1em;
left: 0;
z-index: -1000;
}
h1:after {
content: '';
width: 0;
height: 0;
border: .5em solid #91010B;
border-right-color: transparent;
border-bottom-color: transparent;
position: absolute;
bottom: -1em;
right: 0;
z-index: -1000;
}
h2 {
margin: 2em 0 .5em;
border-bottom: 1px solid #999;
}
pre {
background: black;
padding: 1em 0 0;
-webkit-border-radius: 1em;
-moz-border-radius: 1em;
border-radius: 1em;
color: #9cf;
}
ul {
margin: 0;
padding: 0;
}
li {
list-style-type: none;
padding: .5em 0;
}
.brand {
display: block;
text-decoration: none;
}
.brand .brand-image {
float: left;
border: none;
}
.brand .brand-text {
float: left;
font-size: 24px;
line-height: 24px;
padding: 4px 0;
color: white;
text-transform: uppercase;
}
.brand:hover,
.brand:active {
text-decoration: underline;
}
.brand:before,
.brand:after {
content: ' ';
display: table;
}
.brand:after {
clear: both;
}
</style>
</head>
<body>
<a href="http://openshift.com" class="brand">
<img class="brand-image"
alt="OpenShift logo"
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAgCAYAAABU1PscAAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAARHgAAER4B27UUrQAABUhJREFUWMPFWFlsVGUU/s5/70zbaSltA7RQpJ2lC9CFkQkWIgSJxkAhRA0JCYFq4hPG6JsoGKNCtPigxqhvGlPAuGIaE4igNaElbIW2yNL2tkOtTYGWCqWF2e79fCh7p1Bmpnge/3vuOef7z/nPJiTxMHS6pMRuu6YqFNTTAJYSyAU4GZB0AH2AGCANAfc5Qrba6T3HrmECScYLwCioSIcV2AjidQDZ45Q/LJRaWrLV03X89P8GwHB5XwG4DcDkGPWEBKimNrzN094efGQAzjm9GWHFr4R4LiHKgFaSL3r8zYcmHEBbkW+KFo7UEyhKsNeHlMgyV8eJo4kQpqId9ub6HCoc+XWcxl8lcBTATwDax8GfZtHa054/f/bNg8ZcnyOhHjBc834E8MJ9/vML8aYZQX1hd1PP3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iDUNwhggPujpZTuCMXGwUV6cJgKYnNIJffR3df2NLLZ5871puQrUR//pzpU7rOnAfJP53eDELrsoPpk4RIGRn5xqIBAAdBOCAoBjBjPJsJUdZSt9HSOGFrld5cn2M4KbwfkIUJzqYhQlYWdJ7YN2FrFQCY3nPsmk61AuSuRNYyUdaiRBk/7tViR37Zcir1JYC8WNshgjWWPfhq0dmzVx/5bhQAWnLKU1Md8gZHOsjxAgmD2GEKq4s6m1sxASQPu16HiBh53goqPg9ac0TEcwNQEOBlQAZEcMgC94dDZt2c7r8GMIH0H43ZRDC51RVCAAAAAElFTkSuQmCC">
<div class="brand-text"><strong>Open</strong>Shift</div>
</a>
<h1>
Welcome to OpenShift, JBossEAP6.0 Cartridge
</h1>
<p>
Place your application here
</p>
<p>
In order to commit to your new project, go to your projects git repo (created with the rhc app create command) directory.
</p>
<p>
For example, if you named your application myfirstapp (by passing in -a myfirstapp to the rhc app create command),
you would find the contents of this app located under myfirstapp/src/main/webapp. You can edit that and push your
changes from the myfirstapp directory by running:
</p>
<pre>
git commit -a -m 'Some commit message'
git push
</pre>
<p>
Then reload this page.
</p>
<p>See the myfirstapp/README file for more information on the options for deploying applications.</p>
<h2>Sample Applications</h2>
<p>To get started you can either modify the default war or try one of these samples:
<ul>
<li><a href="https://github.com/openshift/kitchensink-example">https://github.com/openshift/kitchensink-example</a> this quickstart showcases some of the exciting Java EE6 features available on JBoss AS 7.1.</li>
<li><a href="https://github.com/openshift/kitchensink-html5-mobile-example">https://github.com/openshift/kitchensink-html5-mobile-example</a> based on kitchensink (above), but with an HTML5 client that displays great on a PC or mobile device.</li>
<li><a href="https://github.com/openshift/tweetstream-example">https://github.com/openshift/tweetstream-example</a> a TweetStream example</li>
</ul>
<h4>Example usage:</h4>
<pre>
cd kitchensink
git remote add upstream -m master git://github.com/openshift/kitchensink-example.git
git pull -s recursive -X theirs upstream master
</pre>
</p>
<h2>Debugging</h2>
<p>View debugging information about the server environment including memory pools by loading this JSP page: <a href="snoop.jsp">Debug</a></p>
<h2>
What's next?
</h2>
<ul>
<li>
Why not visit us at <a href="http://www.openshift.com">http://www.openshift.com</a>, or
</li>
<li>
You could get help in the <a href="http://www.openshift.com/forums/openshift">OpenShift forums</a>, or
</li>
<li>
You're welcome to come chat with us in our IRC channel at #openshift on freenode.net
</li>
</ul>
</body>
</html>

283
src/main/webapp/snoop.jsp Executable file
View File

@@ -0,0 +1,283 @@
<HTML>
<HEAD>
<TITLE>JBossEAP6.0 JSP snoop page</TITLE>
<%@ page import="javax.servlet.http.HttpUtils,java.util.Enumeration" %>
<%@ page import="java.lang.management.*" %>
<%@ page import="java.util.*" %>
</HEAD>
<BODY>
<H1>WebApp JSP Snoop page</H1>
<img src="images/jbosscorp_logo.png">
<h2>JVM Memory Monitor</h2>
<table border="0" width="100%">
<tbody>
<tr>
<td colspan="2" align="center">
<h3>Memory MXBean</h3>
</td>
</tr>
<tr>
<td width="200">Heap Memory Usage</td>
<td>
<%=ManagementFactory.getMemoryMXBean().getHeapMemoryUsage()%>
</td>
</tr>
<tr>
<td>Non-Heap Memory Usage</td>
<td>
<%=ManagementFactory.getMemoryMXBean().getNonHeapMemoryUsage()%>
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2" align="center">
<h3>Memory Pool MXBeans</h3>
</td>
</tr>
</tbody>
</table>
<%
Iterator iter = ManagementFactory.getMemoryPoolMXBeans().iterator();
while (iter.hasNext()) {
MemoryPoolMXBean item = (MemoryPoolMXBean) iter.next();
%>
<table style="border: 1px #98AAB1 solid;" border="0" width="100%">
<tbody>
<tr>
<td colspan="2" align="center"><strong><%= item.getName() %></strong></td>
</tr>
<tr>
<td width="200">Type</td>
<td><%= item.getType() %></td>
</tr>
<tr>
<td>Usage</td>
<td><%= item.getUsage() %></td>
</tr>
<tr>
<td>Peak Usage</td>
<td><%= item.getPeakUsage() %></td>
</tr>
<tr>
<td>Collection Usage</td>
<td><%= item.getCollectionUsage() %></td>
</tr>
</tbody>
</table>
<%
}
%>
<H2>Request information</H2>
<TABLE>
<TR>
<TH align=right>Requested URL:</TH>
<TD><%= HttpUtils.getRequestURL(request) %></TD>
</TR>
<TR>
<TH align=right>Request method:</TH>
<TD><%= request.getMethod() %></TD>
</TR>
<TR>
<TH align=right>Request URI:</TH>
<TD><%= request.getRequestURI() %></TD>
</TR>
<TR>
<TH align=right>Request protocol:</TH>
<TD><%= request.getProtocol() %></TD>
</TR>
<TR>
<TH align=right>Servlet path:</TH>
<TD><%= request.getServletPath() %></TD>
</TR>
<TR>
<TH align=right>Path info:</TH>
<TD><%= request.getPathInfo() %></TD>
</TR>
<TR>
<TH align=right>Path translated:</TH>
<TD><%= request.getPathTranslated() %></TD>
</TR>
<TR>
<TH align=right>Query string:</TH>
<TD><% if(request.getQueryString()!=null) out.write(request.getQueryString().replaceAll("<", "&lt;").replaceAll(">","&gt;")); %></TD>
</TR>
<TR>
<TH align=right>Content length:</TH>
<TD><%= request.getContentLength() %></TD>
</TR>
<TR>
<TH align=right>Content type:</TH>
<TD><%= request.getContentType() %></TD>
<TR>
<TR>
<TH align=right>Server name:</TH>
<TD><%= request.getServerName() %></TD>
<TR>
<TR>
<TH align=right>Server port:</TH>
<TD><%= request.getServerPort() %></TD>
<TR>
<TR>
<TH align=right>Remote user:</TH>
<TD><%= request.getRemoteUser() %></TD>
<TR>
<TR>
<TH align=right>Remote address:</TH>
<TD><%= request.getRemoteAddr() %></TD>
<TR>
<TR>
<TH align=right>Remote host:</TH>
<TD><%= request.getRemoteHost() %></TD>
<TR>
<TR>
<TH align=right>Authorization scheme:</TH>
<TD><%= request.getAuthType() %></TD>
<TR>
</TABLE>
<%
Enumeration e = request.getHeaderNames();
if(e != null && e.hasMoreElements()) {
%>
<H2>Request headers</H2>
<TABLE>
<TR>
<TH align=left>Header:</TH>
<TH align=left>Value:</TH>
</TR>
<%
while(e.hasMoreElements()) {
String k = (String) e.nextElement();
%>
<TR>
<TD><%= k %></TD>
<TD><%= request.getHeader(k) %></TD>
</TR>
<%
}
%>
</TABLE>
<%
}
%>
<%
e = request.getParameterNames();
if(e != null && e.hasMoreElements()) {
%>
<H2>Request parameters</H2>
<TABLE>
<TR valign=top>
<TH align=left>Parameter:</TH>
<TH align=left>Value:</TH>
<TH align=left>Multiple values:</TH>
</TR>
<%
while(e.hasMoreElements()) {
String k = (String) e.nextElement();
String val = request.getParameter(k);
String vals[] = request.getParameterValues(k);
%>
<TR valign=top>
<TD><%= k.replaceAll("<", "&lt;").replaceAll(">","&gt;") %></TD>
<TD><%= val.replaceAll("<", "&lt;").replaceAll(">","&gt;") %></TD>
<TD><%
for(int i = 0; i < vals.length; i++) {
if(i > 0)
out.print("<BR>");
out.print(vals[i].replaceAll("<", "&lt;").replaceAll(">","&gt;"));
}
%></TD>
</TR>
<%
}
%>
</TABLE>
<%
}
%>
<%
e = request.getAttributeNames();
if(e != null && e.hasMoreElements()) {
%>
<H2>Request Attributes</H2>
<TABLE>
<TR valign=top>
<TH align=left>Attribute:</TH>
<TH align=left>Value:</TH>
</TR>
<%
while(e.hasMoreElements()) {
String k = (String) e.nextElement();
Object val = request.getAttribute(k);
%>
<TR valign=top>
<TD><%= k.replaceAll("<", "&lt;").replaceAll(">","&gt;") %></TD>
<TD><%= val.toString().replaceAll("<", "&lt;").replaceAll(">","&gt;") %></TD>
</TR>
<%
}
%>
</TABLE>
<%
}
%>
<%
e = getServletConfig().getInitParameterNames();
if(e != null && e.hasMoreElements()) {
%>
<H2>Init parameters</H2>
<TABLE>
<TR valign=top>
<TH align=left>Parameter:</TH>
<TH align=left>Value:</TH>
</TR>
<%
while(e.hasMoreElements()) {
String k = (String) e.nextElement();
String val = getServletConfig().getInitParameter(k);
%>
<TR valign=top>
<TD><%= k %></TD>
<TD><%= val %></TD>
</TR>
<%
}
%>
</TABLE>
<%
}
%>
</BODY>
</HTML>