NonStop Servlets for JavaServer Pages (NSJSP) 6.0 System Administrator's Guide
Programming and Management Features
NonStop Servlets for JavaServer Pages (NSJSP) 6.0 System Administrator’s Guide—544548-004
4-5
Using the Servlet API
the init(ServletConfig) method to perform any necessary initialization
the ServletRequest and ServletResponse services
the HttpServletRequest and HttpServletResponse service method to
process requests as the application requires
the destroy() method to deallocate resources gracefully.
Your servlet must also use the doGet() and doPost() methods where applicable.
The HttpServletRequest Class
This class extends the ServletRequest class that provides methods to retrieve
information from a standard input stream and to obtain the values of various headers
and environment variables. The HttpServletRequest class defines methods to
obtain HTTP-protocol header information and CGI environment variables such as
QUERY_STRING, PATH_INFO, and PATH_TRANSLATED.
To obtain an enumeration of all the CGI environment variables in effect for a servlet,
use the getHeaderNames() or getAttribute() methods with the string
parameter value com.tandem.servlet.attribute_names.
The HttpServletResponse Class
The HttpServletResponse class extends the ServletResponse class that
provides methods to write messages to the standard output stream and the error file.
The HttpServletResponse class defines methods to send HTTP response headers
and error information to the web client.
To generate its own response headers, a servlet must generate all such headers
before writing any data to the output stream.
Example:
CONTENT_TYPE=text/html
The ServletException Class
This class provides methods to report servlet-specific exceptions. To report an error,
the doGet() and doPost() methods in your servlet must use this class, or a class
you derive from the ServletException class.










