HttpServlet Class

The HttpServer requires an implementation of an HttpServlet in order to process HTTP requests.

Constructors

There are no public constructors.

Public Methods

init( Object servletConfig ) returns void
Called by the servlet container to indicate to a servlet that it is being placed into service.
destroy( ) returns void
Called by the servlet container to indicate to a servlet that it is being taken out of service or that the server is shutting down.
processRequest( HttpServletRequest request, HttpServletResponse response ) returns void
This method is called each time the server receives an http request (GET, POST, HEAD, etc.). Use this method to formulate a response to the client.
getServletContext( ) returns ServletContext
Returns the ServletContext.
setServletContext( ServletContext servletContext ) returns void
getServletPath( ) returns String
Returns the path to the servlet. This path starts with a "/" character and includes either the servlet name or a path to the servlet, but does not include any extra path information or a query string.
setServletPath( String servletPath ) returns void
Used to set the path to the servlet.
log( String str ) returns void
Writes the specified message to a servlet log. This method has not been implemented.
setAuthenticator( Authenticator authenticator ) returns void
Used to define an Authenticator used to authenticate requests.
setKeyStore( KeyStore keystore, String passphrase ) returns void
Used to specify a KeyStore. The KeyStore is used to store keys and certificates for SSL.
setKeyStore( java.io.File keyStoreFile, String passphrase ) returns void
Used to specify a KeyStore. The KeyStore is used to store keys and certificates for SSL.
setKeyManager( javax.net.ssl.KeyManager keyManager ) returns void
Used to specify a KeyManager. The KeyManager is responsible for managing keys and certificates found in a KeyStore and is used to initialize the SSLContext. Typically, users are not required to specify a KeyManager. Instead, a KeyManager is selected for you whenever the setKeyStore() method is called. However, in some cases, the default KeyManager is not adequate (e.g. managing KeyStores with multiple SSL certificates) and users need to specify a different KeyManager.
setTrustStore( KeyStore truststore ) returns void
Used to set the TrustStore and initialize the TrustManagerFactory. The TrustStore is used to store public keys and certificates for SSL.
setTrustStore( java.io.File trustStoreFile, String passphrase ) returns void
Used to set the TrustStore and initialize the TrustManagerFactory. The TrustStore is used to store public keys and certificates for SSL.
setSSLProvider( java.security.Provider provider ) returns void
Used to specify an Security Provider used to decrypt SSL/TLS messages.
setSSLProvider( String provider ) returns void
Used to specify an Security Provider used to decrypt SSL/TLS messages.
getSSLContext( ) returns SSLContext
Used to initialize an SSLContext which, in turn is used by an SSLEngine decrypt SSL/TLS messages.
supportsHttps( ) returns boolean
Returns true if the servlet has been configured to support HTTP/SSL. This is determined by checking if a KeyStore or a KeyManager has been assigned.