Testing a servlet

A quick and easy way to test the ServletSample is to invoke it by URL in your browser. The ServletSample includes a parameter, myname, that should be included in the URL.

Perform these steps to invoke ServletSample:

  1. Make sure your HTTP Server for i5/OS instance is running. As another option, you can use the HTTP Server internal to WebSphere Application Server - Express.

  2. If your server instance is not running, use the HTTP Server Administration interface to start it. For more information, see Start and test a new WebSphere Application Server - Express application server in the Administration topic.

  3. Go to: http://your.server.name/servlet/ServletSample?myname=yourname, where your.server.name is your Web server domain name, and where yourname is your first name. Press Enter.

    Note: If your HTTP server instance does not use the default port, specify the port number. For example, your.server.name:8000

    In your browser, a page that is titled Just a basic servlet displays. Under the heading is a line that reads Your name, this is a very basic servlet., where Your name is the value you typed at the end of the URL in the previous step.