View Single Post
  #2  
Old 06-02-2009, 02:06 PM
bholus7
Guest
 
Posts: n/a
* Test the server.
1. Verify that you can start the server. Double-click install_dir/bin/startup.bat and try accessing http://localhost/.

2. Check that you can access your own HTML & JSP pages. Drop some simple HTML and JSP pages into install_dir/webapps/ROOT and access them with http://localhost/filename.

3. Try Compiling and Deploying Servlets.
* Set up your development environment.

1. Create a development directory. Put it anywhere except within the Tomcat installation hierarchy.

2. Make shortcuts to the Tomcat startup & shutdown Scripts. Put shortcuts to install_dir/bin/startup.bat and install_dir/bin/shutdown.bat in your development directory and/or on your desktop.

3. Set your CLASSPATH. Include the current directory ("."), the servlet/JSP JAR files (install_dir/common/lib/servlet-api.jar and install_dir/common/lib/jsp-api.jar), and your main development directory from Step 1.

4. Bookmark the servlet & JSP javadocs. Add install_dir/webapps/tomcat-docs/servletapi/index.html and install_dir/webapps/tomcat-docs/jspapi/index.html to your bookmarks/favorites list.

* Compile and test some simple servlets.

1. Test a packageless servlet. Compile a simple servlet, put the .class file in install_dir/webapps/ROOT/WEB-INF/classes, and access it with http://localhost/servlet/ServletName.

2. Test a servlet that uses packages. Compile the servlet, put the .class file in install_dir/webapps/ROOT/WEB-INF/classes/packageName, and access it with http://localhost/servlet/packageName.ServletName.

3. Test a servlet that uses packages and utility classes. Compile a servlet, put both the servlet .class file and the utility file .class file in install_dir/webapps/ROOT/WEB-INF/classes/packageName, and access the servlet with http://localhost/servlet/packageName.ServletName.

This third step verifies that the CLASSPATH includes the top level of your development directory.
* Establish a simplified deployment method.

1. Copy to a shortcut. Make a shortcut to install_dir/webapps/ROOT. Copy packageless .class files directly there. With packages, copy the entire directory there.

2. Use the -d option of javac. Use -d to tell Java where the deployment directory is.

3. Let your IDE take care of deployment. Tell your IDE where the deployment directory is and let it copy the necessary files.

4. Use ant or a similar tool. Use the Apache make-like tool to automate copying of files.

* Get more info. Access the complete set of Tomcat docs, get free JSP and servlet tutorials, read the official servlet and JSP specifications, get JSP-savvy editors and IDEs, look for J2EE jobs, etc.
Reply With Quote