The DefaultServletEngine sample contains a server definition which supports servlets using default configuration settings for the HTTP transport and webcontainer. It also contains a very simple web application, ServletApp.war, which contains a single Servlet, SimpleServlet. This servlet prints the following message in your browser window: "Simple Servlet ran successfully".
This sample can be installed onto runtime versions 184.108.40.206 and later.
Online installation (requires 220.127.116.11 or later):
installUtility install ServletSample
Any missing features required by the server will be installed for you.
ServletSample.jarusing the download button at the top of the page and place it in the root of your server installation.
java -jar ServletSample.jar
Any missing features required by the server will need to be installed separately.
To run the ServletApp application:
bindirectory in the Liberty profile installation:
server run ServletSample
CWWKZ0001I: Application ServletApp started in XX.XX seconds.
Simple Servlet ran successfully
ServletApp.war file contains the source and binaries for the application, and can be used to import it to Eclipse.
The application is automatically installed because it is located in the server dropins directory. Any number of applications can be installed from this location.