Sun Microsystems Logo



Sun Java System Web Server
Java Samples

Before Working With the Samples

Review the following sections before you work with the sample applications:

1. Set Up Your Environment

This product does not include the Ant Java[tm]-based build tool (available at http://ant.apache.org). You must download and install ant version 1.4.1. For more information, see Using Ant With the Samples. Before deploying sample applications to Sun Java System Web Server, make sure your web server environment is functioning properly. Be sure to add the following directory to your PATH environment variable: ant_home/bin

2. Review the Samples Directory Structure

The sample applications included in the web server installation are packaged according to a consistent structure. Each sample's directory structure represents a typical source code directory structure layout. For more information about the organization of the samples, see Samples Directory Structure.

3. Review Using Ant With the Samples 

All of the samples include build.xml files that enable you to use the Java[tm]-based Ant build facility to easily recompile, reassemble, and redeploy the sample applications. For more information on using Ant with the samples, see Using Ant with the Samples.

4. Deploying Samples and Creating the Resources Using the Administration GUI 

All of the samples include a pre-built WAR file. You can deploy the WAR file using the Administration GUI. For more information, see Deploying Samples and Creating the Resources Using Admin GUI.

5. Review Using PointBase With the Samples

See the Using PointBase With the Samples for information about how to download, install, and configure the PointBase server when you are using the web server.

6. Review Using Oracle With the Samples

The samples that require database connections can also work with an Oracle RDBMS. For more information about using an Oracle RDBMS with the samples, see Using Oracle with the Samples.

Samples Index

A complete index of Java sample applications provided as part of the Sun Java System Web Server product is listed below:

apis/

This directory contains source code of the extensible session manager and session store API that was published in the previous release of Web Server (6.0). These APIs have been deprecated since SunONE Web Server 6.1 and are provided in this directory for the purpose of backward compatibility.        

simple/

Basic JSP and servlet examples combined into a single web application (Tomcat samples)

caching/

JSP and servlet examples demonstrating how to cache results of JSP and servlet execution

jstl/

Basic examples that demonstrate usage of the JSP Standard Tag Library

rmi-iiop/

Basic example of using a servlet to access a stateless EJB using RMI/IIOP running in Sun Java System Application Server 8.x

javamail/

A servlet that uses the Javamail API to send an email message

i18n/

A basic Java EE web application that demonstrates how to dynamically change the display language based on user preference


jsf/

Example showing how to use Java Server Faces components to quickly build web application user interfaces.

carstore/

Online car store sample

components/

JSF custom components sample

guessNumber/

Guess Number sample


jdbc/

Java DataBase Connectivity examples are included in the following directories:

simple/

Basic servlet accessing an RDBMS using JDBC

blob/

Servlet accessing Binary Large Objects (BLOBs) using JDBC

transactions/

Servlet using the transaction API within JDBC to control a local transaction

rowset/

Demonstrates the JDBC Rowset feature


jndi/

Java Naming and Directory Interface examples are in the following directories:

custom/

Demonstrates how to use the custom resource

external/

Demonstrates how to use the external resource

read env/

Demonstrates how to use the environment entries specified in the web.xml

url/

Demonstrates how to use the servlet with the URL resource facility to access a resource


security/

Examples demonstrating how to secure Java EE web applications through standard authentication mechanisms and access controls. Security examples are included in the following directories:

basic-auth/

Examples demonstrating how to develop, configure, and exercise basic authentication

form-auth/

Examples demonstrating how to develop, configure, and exercise form-based authentication

client certificate/

Examples demonstrating how to develop, configure, and exercise client certificate authentication

jdbc realm/

Examples demonstrating how to develop, configure, and exercise JDBC realm authentication


webservices/security/

Webservices Security Example

fromwsdl-soap12/

Demonstrates how to develop, configure, and run a simple webservices security sample