Previous | Next | Trail Map | Servlets | Interacting with Clients

Providing a Servlet Description

Some applications, such as the Java Web Server Administration Tool, get descriptive information from the servlet and display it. The servlet description is a string that can describe the purpose of the servlet, its author, its version number, or whatever the servlet author deems important.

The method that returns this information is getServletInfo, which returns null by default. You are not required to override this method, but applications are unable to supply a description of your servlet unless you do.

The following example shows the description of the BookStoreServlet:
 

    public class BookStoreServlet extends HttpServlet {
        ...
        public String getServletInfo() {
            return "The BookStore servlet returns the " +
                   "main web page for Duke's Bookstore.";
        }
    }


Previous | Next | Trail Map | Servlets | Interacting with Clients