Sun Java System Web Server 6.1 SP10 Getting Started Guide

Deploying Web Application

A web application is a collection of servlets, JSPs, HTML documents, and other web resources which might include image files, compressed archives, and other data.

To deploy a web application using the web-based Sun Java System Web Server interface, you need to specify where the web archive (WAR) file for the application is located.

In this chapter, we will use a sample application that is bundled with Sun Java System Web Server to walk through the steps involved in deployment. For details on how to create a web application and write servlets and JSPs, see the Sun Java System Web Server 6.1 SP10 Programmer’s Guide to Web Applications.

The WAR file is located in the server_root/plugins/java/samples/webapps/simple directory, webapps-simple.war,, for a simple web application.

ProcedureTo deploy web application

  1. Access the virtual server and click on the Web Applications tab

    Figure 6–1 Deploying Web Application

    Deploying web application

  2. Select Server Machine from the “WAR File On” drop-down list and click the Go button.

  3. Specify the following:

    • The absolute path to the sample WAR file, webapps-simple.war:

      <install_root>/plugins/java/samples/webapps/simple/webapps-simple.war

      • The application URI:

        /simple.

        You do not make any changes to the default installation directory

  4. Click OK and then Apply to save and apply your changes.

  5. To launch the application, type the following URL in a browser window:

    http://server-name:port/simple

    Figure 6–2 Web Application Page — Sample 1

    Web application page — sample 1

    The web application contains a listing of several sample web applications that you can run. Traverse the JSP and servlet links to execute each sample web application, as shown in Figure 6-3: Web Application Page - Sample 2:

    Figure 6–3 Web Application Page — Sample 2

    Web application page — sample 2

    The page server_root/plugins/java/samples/index.html is a good place to begin exploring and running the sample applications that are bundled with Sun Java System Web Server. For more information about how to set up database connectivity and use Java resources in web applications, see Chapter 7, Setting Up Database Connectivity .