From bfe2ad3598deab78af9336ca4241de0c107a48f8 Mon Sep 17 00:00:00 2001 From: Keith Donald Date: Tue, 9 Jan 2007 06:15:51 +0000 Subject: [PATCH] polishing, added a bit about WTP --- .../docs/reference/src/practical.xml | 82 ++++++++++++------- 1 file changed, 53 insertions(+), 29 deletions(-) diff --git a/spring-webflow/docs/reference/src/practical.xml b/spring-webflow/docs/reference/src/practical.xml index dc097d50..594a9453 100644 --- a/spring-webflow/docs/reference/src/practical.xml +++ b/spring-webflow/docs/reference/src/practical.xml @@ -49,7 +49,7 @@ - Running the Samples + Running the Web Flow sample applications The samples can be built from the command line and imported as Eclipse projects - all samples come with Eclipse project settings. It is also possible to start by importing the samples into Eclipse @@ -58,49 +58,73 @@ Building from the Command Line - Java 1.5 (or greater) and Ant 1.6 (or greater) are prerequisites for running the build. Ensure - those are present in the system path or are passed on the command line. Open a prompt, cd to the - directory where Spring Web Flow was unzipped and run the following: + Java 1.5 (or greater) and Ant 1.6 (or greater) are prerequisites for building the sample applications. + Ensure those are present in the system path or are passed on the command line. To build Web Flow + samples from the command line, open a prompt, cd to the directory where Spring Web Flow was + unzipped and run the following: cd projects/spring-webflow/build-spring-webflow ant dist This builds all samples preparing "target" areas within each sample project subdirectory - containing webapp structures in both exploded and WAR archive forms. The build provides targets - for deploying to Tomcat. However these webapp structures can be copied to any servlet container. - - - - Deploying to Tomcat - - In order to use the Ant Tomcat tasks cd to the projects/spring-webflow/build-spring-webflow - subdirectory (relative to where Spring Web Flow was unzipped) and add the following property - to the build.properties file (create it if it doesn't exist): - -tomcat.dir=c:/tomcat - - where c:/tomcat is the location of the Tomcat installation to deploy to. When this is done run - "ant tomcat-copy-war" from the same directory to copy all sample applications. + containing webapp structures in both exploded and WAR archive forms. The build also provides basic helper targets + for deploying to Tomcat from Ant; however these webapp structures can be copied to any servlet container, + and each project is also a Eclipse Dynamic Web Project (DWP) for easy deployment inside Eclipse + with the Eclipse Webtools project (WTP). Importing Projects into Eclipse Importing the sample projects into Eclipse is easy. With a new or an existing workspace select: - File > Import > Existing Projects into Workspace. In the resulting dialog browse to the project + File > Import > Existing Projects into Workspace. In the resulting dialog browse to the project subdirectory where Spring Web Flow was unzipped and choose it as the root directory to import form. - Press OK. Here Eclipse will list all projects it found including the samples projects. Press Finish and - allow the build to complete. + Select OK. Here Eclipse will list all projects it found including the sample application projects. + Select the projects you're interested in, and select Finish. - If you previously did a build from the command line Eclipse will compile with no errors. If not - you will need to run the ant build once for these errors to clear and you can do that within - Eclipse. Expand the build-spring-webflow project in Eclipse, right-click build.xml and select: - Run As > Ant Build. This will run the default Ant target and will build all sample projects. - When this is done all errors in the Eclipse problems view should go away. Next you can run the - "tomcat-copy-war" Ant task if you didn't alread do so (see the previous section). + If you previously built each project from the command line Eclipse will compile with no errors. + If not you will need to run the Ant build once for these errors to clear + and you can do that within Eclipse. + + + To build all projects inside Eclipse, import and expand the build-spring-webflow project, right-click on + build.xml and select Run As > Ant Build. + Doing this will run the default Ant target and will build all sample projects. + + + To build a single project inside Eclipse, simply select the project, right-click, and + select Run As > Ant Build. You can also use the convenient + shortcut ALT + SHIFT + X (Execute menu), then Q (Run Ant Build). + + + After ant runs and the libraries needed to compile each project are downloaded, + all errors in the Eclipse problems view should go away. Try refreshing a project (F5) + if you still have errors. In general, from this point on you no longer need Ant: you + can rely on Eclipse's incremental compile and Eclipse's web tools (WTP) built-in JEE support + for deployment. (Ant is only needed in the system for command-line usage or when the list of + jar dependencies for a project changes and new jars need to be downloaded). - + + + Deploying projects inside Eclipse using Eclipse Web Tools (WTP) + + Each Spring Web Flow sample application project is a Eclipse Dynamic Web Project (DWP), + for easy deployment to a server running inside the Eclipse IDE. To take advantage + of this, you must be running Eclipse 3.2 with Web Tools 1.5. + + + To run a sample application as a webapp inside Eclipse, simply select the project, + right-click, and select Run -> Run On Server. A convenient + shortcut for this action is ALT + SHIFT + X (Execute menu), R (Run on Server). + The first time you do this you will be asked to setup a Server, where you are + expected to point Eclipse to a location where you have a Servlet Container + such as Apache Tomcat installed. Once your container has been setup and you finish the + deployment wizard, Eclipse will start the container and automatically publish + your webapp to it. In addition, it will launch a embedded web browser allowing you + to run the webapp fully inside the IDE. + + Other IDE's