diff --git a/org.springframework.samples.petclinic/db/mysql/petclinic_db_setup_mysql.txt b/org.springframework.samples.petclinic/db/mysql/petclinic_db_setup_mysql.txt
index 3a2b22e0ad..66727e190a 100644
--- a/org.springframework.samples.petclinic/db/mysql/petclinic_db_setup_mysql.txt
+++ b/org.springframework.samples.petclinic/db/mysql/petclinic_db_setup_mysql.txt
@@ -6,7 +6,7 @@
--------------------------------------------------------------------------------
-1) Download and install the MySQL database (e.g., MySQL Community Server 5.0.x),
+1) Download and install the MySQL database (e.g., MySQL Community Server 5.1.x),
which can be found here: http://dev.mysql.com/downloads/
2) Download Connector/J, the MySQL JDBC driver (e.g., Connector/J 5.1.x), which
diff --git a/org.springframework.samples.petclinic/readme.txt b/org.springframework.samples.petclinic/readme.txt
index 6dcb667d94..aee19b7ffe 100644
--- a/org.springframework.samples.petclinic/readme.txt
+++ b/org.springframework.samples.petclinic/readme.txt
@@ -59,10 +59,10 @@ Available build commands:
- ant clean jar --> cleans the project and builds the WAR
After building the project with "ant clean jar", you will find the
-resulting WAR file in the "target" directory. By default, an embedded
-HSQLDB instance in configured. No other steps are necessary to get the
-data source up and running: you can simply deploy the built WAR file
-directly to your Servlet container.
+resulting WAR file in the "target/artifacts" directory. By default, an
+embedded HSQLDB instance in configured. No other steps are necessary to
+get the data source up and running: you can simply deploy the built WAR
+file directly to your Servlet container.
For MySQL, you'll need to use the corresponding schema and SQL scripts in
the "db/mysql" subdirectory. Follow the steps outlined in
diff --git a/org.springframework.samples.petclinic/src/main/webapp/html/tutorial.html b/org.springframework.samples.petclinic/src/main/webapp/html/tutorial.html
index 91bd57e13c..c368efc349 100644
--- a/org.springframework.samples.petclinic/src/main/webapp/html/tutorial.html
+++ b/org.springframework.samples.petclinic/src/main/webapp/html/tutorial.html
@@ -13,7 +13,8 @@
The Spring PetClinic Application
- Updated: | 21.OCT.2007 | Sam Brannen |
+ Updated: | 11.OCT.2009 | Sam Brannen (Work In Progress: not yet fully updated regarding Spring 3.0) |
+ | 21.OCT.2007 | Sam Brannen |
| 30.JUN.2006 | Costin Leau |
| 01.DEC.2004 | Ken Krebs |
| 16.AUG.2003 | Ken Krebs |
@@ -134,7 +135,7 @@
specifically for Apache Tomcat. These files specify container-supplied
connection-pooled data sources. It is not necessary to use these files.
The application has been configured by default to use a data source
- without connection pooling to simplify usage. Configuration details are
+ with connection pooling. Configuration details are
provided in the Developer Instructions section. The view technologies
that are to be used for rendering the application are Java Server Pages
(JSP) along with the Java Standard Tag Library (JSTL).
@@ -145,7 +146,7 @@
The sample application uses a relational database for data storage.
Support has been provided for a choice of 1 of 2 database selections,
MySql or HypersonicSQL. HypersonicSQL version 1.8.0 is the default
- choice and a copy is provided with the application. It is possible to
+ choice. It is possible to
easily configure the application to use either database. Configuration
details are provided in the Developer Instructions section.
@@ -161,8 +162,7 @@
- Java SDK 1.5.x
- Ant 1.7.x
- - Tomcat 5.x.x, or some other web application container
- - JUnit 4.4 - needed to run the tests
+ - Tomcat 6.x.x, or some other Java Servlet container
- (Optional) MySQL 5.x with MySQL Connector/J 5.x
@@ -310,10 +310,10 @@
Spring supports the use of the Apache Commons Logging API. This API
provides the ability to use Java 1.4 loggers, the simple Commons loggers,
- and Apache Log4J loggers. PetClinic uses Log4J to provide sophisticated
+ and Apache log4j loggers. PetClinic uses log4j to provide sophisticated
and configurable logging capabilities. The file,
- war/WEB-INF/log4j.properties
- configures the definition of Log4jloggers.
+ src/main/resources/log4j.properties
+ configures the definition of log4jloggers.
Business Layer
@@ -503,7 +503,7 @@
org.springframework.samples.petclinic.hibernate.HibernateClinic.
To simplify using Hibernate, Spring provides the
org.springframework.orm.hibernate3.LocalSessionFactoryBean.
- The Hibernate configuration is provided by the file src/petclinic.hbm.xml.
+ The Hibernate configuration is provided by the file src/main/resources/petclinic.hbm.xml.
Java Persistence API (JPA) Clinic Implementation
@@ -518,8 +518,8 @@
To simplify JPA usage, Spring provides (among other classes) the
org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.
The JPA configuration is provided by
- src/META-INF/orm.xml and
- src/META-INF/persistence.xml.
+ src/main/resources/META-INF/orm.xml and
+ src/main/resources/META-INF/persistence.xml.
ApplicationContext
@@ -530,7 +530,7 @@
constitute the Business/Persistence
Layer of PetClinic. The following beans are defined in all 3
versions (1 per access strategy) of the PetClinic
- war/WEB-INF/applicationContext-*.xml
+ src/main/webapp/WEB-INF/applicationContext-*.xml
file:
@@ -542,7 +542,7 @@
properties file, in this case, JDBC-related settings for the
dataSource bean
described below
- (see src/jdbc.properties).
+ (see src/main/resources/jdbc.properties).
dataSource,
which is a singleton bean that defines the implementation of the source
@@ -571,14 +571,14 @@
- - war/WEB-INF/web.xml:
+
- src/main/webapp/WEB-INF/web.xml:
the web application configuration file.
- - war/WEB-INF/petclinic-servlet.xml:
+
- src/main/webapp/WEB-INF/petclinic-servlet.xml:
configures the petclinic dispatcher servlet and the other controllers
and forms that it uses. The beans defined in this file reference the
Business/Persistence Layer beans defined in
applicationContext-*.xml.
- - war/WEB-INF/classes/messages*.properties:
+
- src/main/resources/messages*.properties:
configures the definition of internationalizable message resources.
@@ -652,15 +652,15 @@
In web.xml,
a "log4jConfigLocation" context-param
is specified that sets the location of the
- Log4j configuration file. The
+ log4j configuration file. The
default location for this file is
/WEB-INF/classes/log4j.properties.
Specifying this parameter explicitly allows the location to be changed
from the default and is also used to cause periodic
- Log4j configuration refresh checks.
+ log4j configuration refresh checks.
In web.xml,
a Log4jConfigListener is
- specified that will initialize Log4j using
+ specified that will initialize log4j using
the specified configuration file when the web app starts. The
Log4jConfigListener is commented out
in the file because of a conflict when using JBoss. It should also be
@@ -897,7 +897,7 @@
which displays a stack trace and normally wouldn't be used in a production
version of an application. It can be seen in action by entering a URL of
"editOwner.do" or "editPet.do" with an invalid request parameter, for example:
- /petclinic/owner.do?ownerId=-1.
+ /petclinic/owner.do?ownerId=-1.
The handlers for these URLs normally expect to see a respective "ownerId" or "petId"
request parameter corresponding to an Owner or Pet in the database. Thus,
these handlers will throw a DataAccessException when such
@@ -908,7 +908,7 @@
in a production version of an application. It can be seen in action by
entering a URL of "editOwner.do" or "editPet.do" without a valid request
parameter, for example:
- /petclinic/owner.do.
+ /petclinic/owner.do.
The handlers for these URLs normally expect to see a respective "ownerId" or "petId"
request parameter and throw a ServletException when such
a request parameter is not found.
@@ -1025,60 +1025,28 @@
Downloads
- Download and install the
- Spring Framework
- (examples, including PetClinic are provided)
+ Spring Framework
+ (the PetClinic sample application is included)
- Download and install a Java
Software Developer Kit, version 1.5 or later
- Download and install Apache Ant,
preferably version 1.7.0 or later
- - Download and install JUnit,
- preferably version 4.4 or later
- Download and install Apache Tomcat,
- preferably version 5.5.x or later
- - Download and install MySQL,
- preferably version 5.0.x or later (optional)
+ preferably version 6.0.18 or later
+ - Download and install MySQL,
+ preferably version 5.1.x or later (optional)
- Hypersonic SQL, and
Hibernate are provided with the
application.
- PetClinic and Spring use the Apache
- Commons Logging
- and Log4J
- packages
+ Commons Logging
+ and log4j
+ packages.
Ant Setup
- Make sure that the Ant executable is in your command shell path. Ant
- will need to reference classes from JUnit
- and the database(s) of interest. Place a copy of any needed jar files in
- Ant's /lib directory, i.e.:
-
-
-
- - JUnit - junit.jar
- - HSQL - hsqldb.jar
- - MYSQL - mysql-connector-java-5.1.5-bin.jar or other
-
-
- HSQL Setup
-
- Create a new directory containing a copy of the entire contents of
- the directory petclinic/db/hsqldb.
- The file petclinic.script
- is the data file that will be used by the server. It has been
- initialized with some sample data. Start a server on the standard port
- by executing server.sh(Unix)
- or server.bat (Windows)
- or alternatively edit the file to select a port of your choosing.
- A useful database manager can be started by executing
- manager.sh (Unix)
- or manager.bat (Windows).
- When the application opens, connect to the "HSQL Database Engine
- Server" using the default parameters. This tool can also be used to
- manage other databases. To use a different port, it will be necessary
- to change the PetClinic Database Setup. It may also be necessary to
- consult the HSQL documentation for instructions on how to change the port
- the server uses.
+ Make sure that the Ant executable is in your command shell path.
MYSQL Setup (optional)
@@ -1126,15 +1094,15 @@
separate log file for the petclinic context. This will separate the
container logging for petclinic from that of the other webapps. This
should not be confused with the application log file provided through
- Log4j.
+ log4j.
An Ant script (db/build.xml)
has been provided that can be used to re-initialize either database. To
select or configure the data source and database used for the webapp and
for testing, you will need to edit the following files:
- - war/WEB-INF/applicationContext-*.xml:
+
- src/main/webapp/WEB-INF/applicationContext-*.xml:
for configuring the DataSource in the webapp
- - src/jdbc.properties:
+
- src/main/resources/jdbc.properties:
for configuring JDBC connection settings for both the webapp and testing
- build.properties:
for running the "tests" target in Ant
@@ -1145,12 +1113,11 @@
Building the PetClinic Application
Open a command line shell and navigate to the directory containing
- PetClinic and execute "ant". This will display a list of the Ant
+ PetClinic and execute "ant -p". This will display a list of the Ant
targets that are available. Make sure the database is running and execute
- "ant all". This will run the Ant "all" target which
- will clean and compile everything, generate Javadoc, and execute the tests,
- including a live test using the database. The other Ant targets provide
- subsets of this functionality.
+ "ant clean test". This will run clean and compile everything
+ and execute the tests, including integration tests against an in-memory
+ database.
Deploying the PetClinic Application
@@ -1158,16 +1125,16 @@
Deploy the web application to the server in the usual way (see
notes regarding database setup). If you need
instructions for web application deployment, see the Tomcat
- documentation for details. The Web ARchive file is
- petclinic.war
+ documentation for details. The Web Application aRrchive file is
+ org.springframework.samples.petclinic.war
and can be found in the
- dist directory.
+ target/artifacts directory.
Using the PetClinic Application
Make sure the PetClinic web application is running and browse to
- http://localhost:8080/petclinic.
+ http://localhost:8080/org.springframework.samples.petclinic/.