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 Version 8.0 or Version 8.5
Important: These samples were tested with WebSphere Application Server Version 8.0 and Version 8.5.

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.

Concept topic    

Terms and conditions for product documentation | Feedback

Last updated: January 29, 2018 04:57 AM GMT-06:00
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=was-nd-mp&topic=sample_servlet30
File name: sample_servlet30.html