Chapter 2. Server Setup and Configuration

Topics in This Chapter

  • Installing and configuring Java

  • Downloading and setting up a server

  • Configuring your development environment

  • Testing your setup

  • Simplifying servlet and JSP deployment

  • Locating files in Tomcat, JRun, and Resin

  • Organizing projects into Web applications

Before you can start learning specific servlet and JSP techniques, you need to have the right software and know how to use it. This introductory chapter explains how to obtain, configure, test, and use free versions of all the software needed to run servlets and JavaServer Pages (JSP). The initial setup involves seven steps, as outlined below.

  1. Download and install the Java Software Development Kit (SDK). This step involves downloading an implementation of the Java 2 Platform, Standard Edition and setting your PATH appropriately. It is covered in Section 2.1.

  2. Download a server. This step involves obtaining a server that implements the Servlet 2.3 (JSP 1.2) or Servlet 2.4 (JSP 2.0) APIs. It is covered in Section 2.2.

  3. Configure the server. This step involves telling the server where the SDK is installed, changing the port to 80, and possibly making several server-specific customizations. The general approach is outlined in Section 2.3, with Sections 2.42.6 providing specific details for Apache Tomcat, Macromedia JRun, and Caucho Resin.

  4. Set up your development environment. This step involves setting your CLASSPATH to include your top-level development directory and the JAR file containing the servlet and JSP classes. It is covered in Section 2.7.

  5. Test your setup. This step involves checking the server home page and trying some simple JSP pages and servlets. It is covered in Section 2.8.

  6. Establish a simplified deployment method. This step involves choosing an approach for copying resources from your development directory to the server's deployment area. It is covered in Section 2.9.

  7. Create custom Web applications. This step involves creating a separate directory for your application and modifying web.xml to give custom URLs to your servlets. This step can be postponed until you are comfortable with basic servlet and JSP development. It is covered in Section 2.11.



Core Servlets and JavaServer Pages (Vol. 1.Core Technologies)
Core Servlets and Javaserver Pages: Core Technologies, Vol. 1 (2nd Edition)
ISBN: 0130092290
EAN: 2147483647
Year: 2002
Pages: 194

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net