ITC382 11255412 A1B
From PeacockWiki
(diff) ←Older revision | Current revision | Newer revision→ (diff)
Contents |
Technical Report
Brief installation overview
- Acquire Java JDK, Apache Ant, Eclipse 3.1.x, Tomcat 4.1.30 (Newer versions should work fine), Tapestry 3.0.3, and optionally the Spindle 3.2.0 update site zip (or download directly using eclipse).
Links- JDK 5.0 Update 4
- Apache-ant-1.6.5-bin.* (multi-platform distribution)
- Eclipse 3.1
- Tomcat 4.1.30
- Tapestry 3.0.3
- Spindle 3.2.0 update site zip
or - "http://spindle.sourceforge.net/updates" site update in eclipse "Find and Install" (after eclipse is installed)
- Install Java, Apache Ant, and Tomcat. Use Ant to deploy Tapestry to the tomcat install.
- Execute the Java download file, and follow wizard.
- Extract the ant archive to a permanent location, and add the bin directory to the your path.
- Extract the tomcat archive. Either add JAVA_HOME to your environment variables, or set the variable in the startup and shutdown scripts in the bin directory. JAVA_HOME points to the installation point of the JDK, the directory above the bin directory containing java.exe and javaw.exe.
- Extract the tapestry archive to a temporary location, and follow the instructions in Readme.html under "Configuring Tomcat"
I found the the install failed on downloading Javassist, if you have this problem, try editing the javassist.loc property in config/common.properties, replacing the server telia.dl.sourceforge.net with your own choice of sourceforge mirror, or simply replace the entire link with a selection from http://prdownloads.sourceforge.net/jboss/javassist-2.5.1.zip?download
- Copy tapestry libs into tomcat lib folder
- Copy all files from webapps/workbench/WEB-INF/lib to shared/lib. Alternatively, ensure these files are copied into webapps/project-name/WEB-INF/lib for every tapestry webapp.
- Install Eclipse and Spindle
- Extract the eclipse archive to a permanent location, and run the executable.
- Select Help → Software Updates → Find and Install, choose Select new features to install.
- Proceed with one of the following
- Choose New Remote Site, and enter the name Spindle, and the UpdateSite URL (http://spindle.sourceforge.net/updates)
- Extract the UdateSite Zip, choose New Local Site, and select the location of the extracted files.
- Click Finish
- Explore the tree and select "Spindle 3, and Eclipse Plugin for Tapestry 3.2.0"
- Proceed through the wizard to install spindle
- Restart the workbench when prompted
Sample project
This section will detail the construction of my sample project, how it works, and problems and solutions encountered in its development.
Creating the project
File → New → Project (or first icon on toolbar)
Name the project ("lists")
Continue Next, and Finish (leave all options default).
Set project compiler options, right click on the project, and choose Properties. Select Java Compiler, and select Enable Project Specific Settings. Choose a Compiler Compliance Level of 5.0. (alternatively this can be done through Window → Preferences → Java → Compiler, to set this property for all projects)
Open web.xml, and add the following lines
<filter> <filter-name>redirect</filter-name> <filter-class>org.apache.tapestry.RedirectFilter</filter-class> </filter> <filter-mapping> <filter-name>redirect</filter-name> <url-pattern>/</url-pattern> </filter-mapping>
The default path of a Tapestry app is /app-name/app . If you visit /app-name/ you will recieve an error. These lines will instruct the servlet container (tomcat) to redirect the client to the application.
Open Home.html and place some text between the body tags. Save the file.
Download tomcat-local-deploy.xml and import it in the root directory of the project. Open the file in eclipse, and check the properties match your local configuration, then choose Run → External Tools → Run As → Ant Build. This should install the test app into your tomcat installation, which should be visible by point a browser to http://localhost:8080/lists/ .