Sun Java System Web Server 6.1 SP10 Getting Started Guide

Chapter 6 Running Java Web Applications On Your Server

Sun Java System Web Server 6.1 allows you to create and deploy web applications that extend your server dynamically. Sun Java System Web Server 6.1 provides a runtime environment, the web container, that supports web applications. The web container supports the JavaTM Servlet 2.3 API specification and the JavaServer PagesTM (JSPTM) 1.2 specification, which allow servlets and JSPs to be included in web applications.

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:


      • The application URI:


        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:


    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 .