APPLICATION DESIGN


Example: Java servlet
This example servlet returns an HTML page that displays all the HTTP headers that the browser sent with the servlet request.

import java.util.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class ExampleServlet extends HttpServlet {

} // end of class
After you compile this code, copy the ExampleServlet.class file to your server domino\servlet directory. It does not need any special properties, so you do not need to create a servlets.properties file. Run the servlet from a browser by entering this URL, using the name of your server:

http://www.yourserver.com/servlet/ExampleServlet

The information in the page returned by the servlet depends on the browser. Here is the HTML page returned for a Netscape browser:

<HTML><B>Headers received with the request:</B><BR>
<BR>ACCEPT-LANGUAGE: en
<BR>CONNECTION: Keep-Alive
<BR>ACCEPT: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
<BR>USER-AGENT: Mozilla/4.05 [en] (Win95; U ;Nav)
<BR>ACCEPT-CHARSET: iso-8859-1,*,utf-8
<BR>HOST: test1

See Also