Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Colin Shield
committed
Feb 3, 2014
1 parent
15dd850
commit f59fa9f
Showing
10 changed files
with
226 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<!doctype html> | ||
<%@taglib uri="http://www.springframework.org/tags" prefix="spring" %> | ||
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form" %> | ||
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> | ||
|
||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Spring MVC Application</title> | ||
|
||
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
|
||
<link href="http://twitter.github.io/bootstrap/assets/css/bootstrap.css" rel="stylesheet"> | ||
<link href="http://twitter.github.io/bootstrap/assets/css/bootstrap-responsive.css" rel="stylesheet"> | ||
</head> | ||
|
||
<body> | ||
|
||
<div class="container"> | ||
<div class="row"> | ||
<div class="span8 offset2"> | ||
<h1>Users</h1> | ||
<form:form method="post" action="add" commandName="user" class="form-horizontal"> | ||
<div class="control-group"> | ||
<form:label cssClass="control-label" path="firstName">First Name:</form:label> | ||
<div class="controls"> | ||
<form:input path="firstName"/> | ||
</div> | ||
</div> | ||
<div class="control-group"> | ||
<form:label cssClass="control-label" path="lastName">Last Name:</form:label> | ||
<div class="controls"> | ||
<form:input path="lastName"/> | ||
</div> | ||
</div> | ||
<div class="control-group"> | ||
<form:label cssClass="control-label" path="email">Email:</form:label> | ||
<div class="controls"> | ||
<form:input path="email"/> | ||
</div> | ||
</div> | ||
<div class="control-group"> | ||
<div class="controls"> | ||
<input type="submit" value="Add User" class="btn"/> | ||
</form:form> | ||
</div> | ||
</div> | ||
|
||
<c:if test="${!empty users}"> | ||
<h3>Users</h3> | ||
<table class="table table-bordered table-striped"> | ||
<thead> | ||
<tr> | ||
<th>Name</th> | ||
<th>Email</th> | ||
<th> </th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<c:forEach items="${users}" var="user"> | ||
<tr> | ||
<td>${user.lastName}, ${user.firstName}</td> | ||
<td>${user.email}</td> | ||
<td> | ||
<form action="delete/${user.id}" method="post"><input type="submit" class="btn btn-danger btn-mini" value="Delete"/></form> | ||
</td> | ||
</tr> | ||
</c:forEach> | ||
</tbody> | ||
</table> | ||
</c:if> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</body> | ||
</html> |
14 changes: 14 additions & 0 deletions
14
target/HelloWorld/WEB-INF/classes/META-INF/persistence.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> | ||
<persistence-unit name="defaultPersistenceUnit" transaction-type="RESOURCE_LOCAL"> | ||
<provider>org.hibernate.ejb.HibernatePersistence</provider> | ||
<properties> | ||
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect" /> | ||
<property name="hibernate.connection.url" value="jdbc:hsqldb:mem:spring" /> | ||
<property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver" /> | ||
<property name="hibernate.connection.username" value="sa" /> | ||
<property name="hibernate.connection.password" value="" /> | ||
<property name="hibernate.hbm2ddl.auto" value="create-drop" /> | ||
</properties> | ||
</persistence-unit> | ||
</persistence> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<!doctype html> | ||
<%@taglib uri="http://www.springframework.org/tags" prefix="spring" %> | ||
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form" %> | ||
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> | ||
|
||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Spring MVC Application</title> | ||
|
||
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
|
||
<link href="http://twitter.github.io/bootstrap/assets/css/bootstrap.css" rel="stylesheet"> | ||
<link href="http://twitter.github.io/bootstrap/assets/css/bootstrap-responsive.css" rel="stylesheet"> | ||
</head> | ||
|
||
<body> | ||
|
||
<div class="container"> | ||
<div class="row"> | ||
<div class="span8 offset2"> | ||
<h1>Users</h1> | ||
<form:form method="post" action="add" commandName="user" class="form-horizontal"> | ||
<div class="control-group"> | ||
<form:label cssClass="control-label" path="firstName">First Name:</form:label> | ||
<div class="controls"> | ||
<form:input path="firstName"/> | ||
</div> | ||
</div> | ||
<div class="control-group"> | ||
<form:label cssClass="control-label" path="lastName">Last Name:</form:label> | ||
<div class="controls"> | ||
<form:input path="lastName"/> | ||
</div> | ||
</div> | ||
<div class="control-group"> | ||
<form:label cssClass="control-label" path="email">Email:</form:label> | ||
<div class="controls"> | ||
<form:input path="email"/> | ||
</div> | ||
</div> | ||
<div class="control-group"> | ||
<div class="controls"> | ||
<input type="submit" value="Add User" class="btn"/> | ||
</form:form> | ||
</div> | ||
</div> | ||
|
||
<c:if test="${!empty users}"> | ||
<h3>Users</h3> | ||
<table class="table table-bordered table-striped"> | ||
<thead> | ||
<tr> | ||
<th>Name</th> | ||
<th>Email</th> | ||
<th> </th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<c:forEach items="${users}" var="user"> | ||
<tr> | ||
<td>${user.lastName}, ${user.firstName}</td> | ||
<td>${user.email}</td> | ||
<td> | ||
<form action="delete/${user.id}" method="post"><input type="submit" class="btn btn-danger btn-mini" value="Delete"/></form> | ||
</td> | ||
</tr> | ||
</c:forEach> | ||
</tbody> | ||
</table> | ||
</c:if> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> | ||
<persistence-unit name="defaultPersistenceUnit" transaction-type="RESOURCE_LOCAL"> | ||
<provider>org.hibernate.ejb.HibernatePersistence</provider> | ||
<properties> | ||
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect" /> | ||
<property name="hibernate.connection.url" value="jdbc:hsqldb:mem:spring" /> | ||
<property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver" /> | ||
<property name="hibernate.connection.username" value="sa" /> | ||
<property name="hibernate.connection.password" value="" /> | ||
<property name="hibernate.hbm2ddl.auto" value="create-drop" /> | ||
</properties> | ||
</persistence-unit> | ||
</persistence> |