The JavaTM Tutorial
Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form

Trail: Servlets
Lesson: Interacting with Clients

Providing a Servlet Description

Some applications 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 Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form

Copyright 1995-2001 Sun Microsystems, Inc. All rights reserved.