Servlet 3.0 samples

Servlet 3.0 samples demonstrate new Servlet 3.0 functionality. Learn how to programmatically add servlets, configure web fragments, use an asynchronous servlet, or use a ServletContainerInitializer.

Time required to set up and configure these samples

10 minutes

Prerequisites for use

  • WebSphere® Application Server V8.0
Important: These samples were tested with WebSphere Application Server Version 8.0.

Samples download

To use the samples, download Servlet 3.0 sample files from a product download site. Complete the following steps:

  1. Choose one of the following methods to download the ServletSamples.zip file to a directory on your workstation: FTP or HTTP. You might create the /samples/ServletSamples directory path on your workstation and download Servlet 3.0 sample files to that directory path.
  2. From the displayed dialog, specify the target directory to which to save the compressed file and click OK.
    The ServletSamples.zip file contains sample files in the following directory structure:
    /images
    /installableApps
    /META_INF
    /scripts
    /src
    /style
    build.xml
    readme.html
    Attention: The readme.html file contains information for installing and running the sample.

Samples description

SampleProgrammatic.war

This sample shows how to programmatically add servlets, filters, and/or listeners. For more information, see the Servlet 3.0 programmatic configuration topic.

SampleAsyncContext.war

This sample shows how to use an asynchronous servlet to process a long running request and then dispatch back to write out the response. For more information, see the Java Servlet 3.0 considerations topic.

SampleWebFragment.war

This sample shows how to include a JAR file that contains a web-fragment.xml file. For more information, see the Web fragments topic.

SampleServletContainerInitializer.war

This module shows how to use a ServletContainerInitializer to help initialize the application. For more information, see the Servlet 3.0 programmatic configuration topic.




Related concepts
Servlet 3.0 programmatic configuration
Java Servlet 3.0 considerations
Web fragments
Related tasks
WebSphere Application Server Version 8.0 samples
Concept topic Concept topic    

Terms of Use | Feedback

Last updatedLast updated: Sep 20, 2011 1:12:33 AM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=matt&product=was-nd-mp&topic=sample_servlet30
File name: sample_servlet30.html