Sample Servlets

Pi3Web
This page shows the capabilities of Pi3Web v2.0 to act as a simple, Servlet API 2.1 compliant Servlet Engine. It is required to install a valid JRE 1.2.2 or JRE 1.3.1 and to setup Pi3Web to run with the Servlet configuration (Conf/Servlet.pi3) before you can try this tests. The Servlet objects are described here. Further information is available in the Servlets Howto.

"Hello World" Test


This test will invoke a simple Servlet, which will print out "Hello World" message and the initialization parameters read from the ServletConfig. This test is also an example how a Servlet within a package should be called.

POST Test


This test will perform a POST of the HTML form data to Servlets using different I/O methods. Click the action buttons below.

Context Test


This test will invoke the ServletContext methods of a Servlet. This method shows how the "DocBase" configuration parameter of the ServletContainer affects the behaviour of path resolution.

Cookie Test


This test will create HTTP cookies and invoke the Cookie object to show this interface.

Dispatch Test


This test will invoke the RequestDispatcher methods of a Servlet to include another Servlet or to forward the request to another Servlet.

Environment Test


This test will invoke the ServletRequest methods to print all the request headers and the parameters.

Session Test


This test shows the lifecycle of a Servlets HttpSession.

JSP Examples

Snoop


This snoop sample shows the access to several HTTP request parameters from within a Jsp.

Date


This calendar sample shows the access to a calendar class encapsulated by a java bean.