examples.flatfile
Class FlatFileServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by examples.flatfile.FlatFileServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class FlatFileServlet
extends javax.servlet.http.HttpServlet

This is a simple example of a HTTPS servlet that uses KeyMaster. The idea is that it is only accessible via Secure Sockets Layer (SSL) and uses a ASCII file to authenticate the user instead of checking the private key files. The file has a number of users and each user has a token which will be returned as a response. The response is formatter using StreamLinkFormatter only. This can easily be extended though.
The servlet checks the URL that requested it to make sure that the URL used HTTPS and not HTTP.

Author:
David Shorten
See Also:
Serialized Form

Field Summary
static String CONFIG_LOGGER_FILE
          The file that all the logging information will be written to.
static String CONFIG_LOGGER_LEVEL
          The level of logging required while this servlet is running.
static String DEFAULT_LOG_FILE
          Specifies a default file to use.
static String DEFAULT_LOG_LEVEL
          Specifies a defualt Level in case the one specified is missing or is invalid.
 
Constructor Summary
FlatFileServlet()
           
 
Method Summary
 void init()
          This method is called by the application server when the server loads or when this servlet is called for the first time.
 
Methods inherited from class javax.servlet.http.HttpServlet
service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_LOGGER_LEVEL

public static final String CONFIG_LOGGER_LEVEL

The level of logging required while this servlet is running. This is specified in the web.xml servlet configuration file.

See Also:
Constant Field Values

CONFIG_LOGGER_FILE

public static final String CONFIG_LOGGER_FILE

The file that all the logging information will be written to. This is specified in the web.xml servlet configuration file.

See Also:
Constant Field Values

DEFAULT_LOG_LEVEL

public static final String DEFAULT_LOG_LEVEL

Specifies a defualt Level in case the one specified is missing or is invalid.

See Also:
Constant Field Values

DEFAULT_LOG_FILE

public static final String DEFAULT_LOG_FILE

Specifies a default file to use. The logger may still be unavailable if the servlet does not have write permissions on the disk it's writing to.

See Also:
Constant Field Values
Constructor Detail

FlatFileServlet

public FlatFileServlet()
Method Detail

init

public void init()
          throws javax.servlet.ServletException

This method is called by the application server when the server loads or when this servlet is called for the first time. The method sets up a logger instance from either web.xml or from default values.

Overrides:
init in class javax.servlet.GenericServlet
Throws:
javax.servlet.ServletException - thrown by parent init method.


Please send bug reports and comments to Caplin support