|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.GenericServlet javax.servlet.http.HttpServlet examples.flatfile.FlatFileServlet
public class FlatFileServlet
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.
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 |
---|
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.
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.
public static final String DEFAULT_LOG_LEVEL
Specifies a defualt Level in case the one specified is missing or is invalid.
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.
Constructor Detail |
---|
public FlatFileServlet()
Method Detail |
---|
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.
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
- thrown by parent init method.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |