-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathREADME.txt
52 lines (38 loc) · 1.75 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Spanners Demo application
This application demonstrates various features and techniques described in Stuart 'Stevie' Leitch's blog: http://www.disasterarea.co.uk/blog/
This demo contains:
- Spring MVC web application
- Struts web application
- Spring-WS SOAP server application
- DAO component shared by all applications
Building the demo
The whole demo can be built using Maven 3:
mvn clean install
Installing the database
The DAO layer requires a MySQL database. The following will create the necessary table:
delimiter $$
CREATE TABLE `spanner` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) default NULL,
`size` int(11) default NULL,
`owner` varchar(255) default NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1$$
Configuring Tomcat
The application has been tested against Tomcat 7. The context.xml must be configured to make the database available to the application using JNDI:
<Resource name="jdbc/Spanners"
auth="Container"
type="javax.sql.DataSource"
username="spanners"
password="password"
driverClassName="com.mysql.jdbc.Driver"
description="spanners"
url="jdbc:mysql://localhost:3306/spanners"
maxActive="15"
maxIdle="3"/>
In addition, the MySQL driver jar should be copied to Tomcat's lib directory. I used this jar:
http://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.21/mysql-connector-java-5.1.21.jar
Starting the applications
Each of the web applications can be deployed to Tomcat from the Tomcat Manager Console. Alternatively they can be deployed using maven:
mvn tomcat:deploy