HttpServlet Class

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

Constructors

public HttpServlet( )

Methods

destroy( ) returns void
getServletContext( ) returns javaxt.http.servlet.ServletContext
Returns the ServletContext.
getSSLContext( ) returns javax.net.ssl.SSLContext
Used to initialize an SSLContext which, in turn is used by an SSLEngine decrypt SSL/TLS messages.
init( Object ServletConfig ) returns void
Called by the servlet container to indicate to a servlet that it is being placed into service.
log( String str ) returns void
processRequest( javaxt.http.servlet.HttpServletRequest request, javaxt.http.servlet.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.
setAuthenticator( javaxt.http.servlet.Authenticator authenticator ) returns void
Used to define an Authenticator used to authenticate requests.
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.
setKeyStore( java.security.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.
setPaths( String contextPath, String servletPath ) returns void
Used to set the context and servlet paths used in the HttpServletRequest.getContextPath() and the HttpServletRequest.getServletPath() methods.
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.
setTrustStore( java.security.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.
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.