Disclaimer - Like you I'm capable of making errors, as I do most of this work in the wee hours of the morning. This code is provided "as is". I made a conscious effort to keep the code as close to the original as possible and only change code that was required to get the project to work.
Java Project T-JAX - shoe.war - UPDATED 3/27
T-JAX Modified Source - source.zip - See below for list of modified code - UPDATED 3/27
MSJDBC Drivers for SQL 2000
This war will deploy on Tomcat 4.1.3 or any other container. You must setup database connections through JNDI, Tomcat's DBCP. The project's ConnectionManager has been modified to use DBCP in Tomcat and looks up the datasource "/jdbc/shoe". This class simply gives a connection from the DBCP and nothing more. Note: YOU MUST DEPLOY THIS ON TOMCAT VERSION 4. If you are using another container, just define the datasource and your should be good to go.
1) Download Tomcat and install it on your computer. MAKE SURE YOU REMOVE ANY SPACES IN THE INSTALLATION PATH. So change the default path from "c:\program files\Apache\Tomcat 4.1" to "c:\Apache\Tomcat4.1" or something similar without spaces. %TOMCAT_HOME% denotes your tomcat installation home directory.
2) Download the MS JDBC Drivers. These drivers are only compatible with MS SQL 2000. Next, copy the jars files from the installation's "lib" directory to %TOMCAT_HOME%\common\lib.
3) Download shoe.war and put it in your %TOMCAT_HOME%/webapps. Start the container and allow it to start-up, then shut it down. This will extract the war file in the webapps directory. Define your Datasource, "/jdbc/shoe". See #4. Start tomcat again and you should be good to go (Assuming you have created the database in SQL 2000).
For all changes to these files, please see http://groups.yahoo.com/group/cpsc542/database.
List of Modified Code:
|ConnectionManager - changed ConnectionManager to user Tomcat connection pooling. All other methods do nothing in this class expect open and close connections. returnConnection and getConnection.||Web Module||Web Module||brippe||3/26/2004|
|Project not packaged properly - web application should be packaged in a war file. Application dependant on app server and db. Removed dependencies to WebLogic.||General||Web Module||Brippe||3/18/04|
|Properties not properly set in the ant build script||Build||Ant Script||Brippe||3/18/04|
|PropertiesManagers - Removed code that searches the classpath to obtain properties.properties file. File now resides in a jar and needs to be loaded appropriately. ALL POJOs and Servlets reside in shoe.jar from within the shoe.war file.||POJOs||Web Module||brippe||3/25/2004|
|getRequestDispatcher had to be changed in ALL Servlets that forward requests to JSPs. The pathname specified may be relative, although it cannot extend outside the current servlet context. If the path begins with a "/" it is interpreted as relative to the current context root. This method returns null if the servlet container cannot return a RequestDispatcher. MODIFIED CartServlet.java, CheckoutServlet.java, LogonServlet.java, RegisterServlet.java. Application used relative paths like /shoe/LoginServlet which will not according to the Java Spec on RequestDispatcher.||Servlets||Web Module||brippe||3/26/2004|
|web.xml - defines url-patterns as /shoe/SERVLETNAME - these urls can be defined relative to the current context. So all <url-patterns> in the web.xml were modified.||Web Module||web.xml||brippe||3/26/2004|
|web.xml - doesn't valid against the dtd - <welcome-file-list> in the wrong location. Need to move it to the bottom of the xml file.||Web Module||web.xml||brippe||3/19/2004|
|web.xml - doesn't valid against the dtd - problem at line 11. This causes problems with deployment in servlet container - <welcome-file-list> in the wrong location.||Web Module||web.xml||Brippe||3/19/2004|
For comments and suggestions please email firstname.lastname@example.org