|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.locomotive.loco.handler.GenericHandler
The GenericHandler class is a generic implementation of the Handler interface. There are two alternative ways to use this class:
Field Summary | |
protected boolean |
already_displayed_page
whether or not a page has been flushed back to the browser. |
protected java.sql.Connection |
conn
The database connection this request can use, if desired. |
static int |
DEBUG
log level to use for debugging |
static int |
ERROR
Log level to use for serious errors; e.g. |
protected FormData |
form_data
the FormData object that contains any form information from a POST. |
protected java.lang.String |
handler_uri
The last part of the url which specifies which Handler to use |
protected HandlerData |
hd
The handlerData object containing information for this request. |
static int |
NORMAL
log level to use for normal activities |
protected Session |
session
the session associated with this request. |
protected java.util.Hashtable |
steam_vars
the substitutions hashtable to be used when evaluating templates. |
protected java.lang.String[] |
url_tokens
the url tokens for this request. |
protected User |
user
the user associated with this request. |
static int |
WARNING
Log level to use for warnings |
Constructor Summary | |
GenericHandler()
|
Method Summary | |
java.lang.String |
displayPage(java.lang.String document_path,
java.util.Hashtable steam_vars)
loads a Steam document, inserts the values of Steam variables into that document, and then writes the result back to the Web server. |
void |
displayString(java.lang.String message)
if you want to send back a single string as the response to the user, you can use this method. |
void |
handleException(java.lang.Exception exception,
java.lang.String short_code)
this is a convenience method you can use when you catch serious Exceptions for which you want a stack trace and you need to send the user an error code, which can help you debug. |
void |
handleRequest(HandlerData hd)
initializes all the local variables. |
boolean |
init(Log server_log)
GenericHandler doesn't do anything in the init() method. |
void |
log(int log_level,
java.lang.String log_message)
writes a message to the locomotive's global server log. |
void |
logEvent(java.lang.String major,
java.lang.String minor,
java.lang.String data)
write one event to the global locomotive event log. |
void |
sayBadURL()
simply tells the user that they typed a bad URL, by sending the message: "I'm sorry, I don't understand that URL." |
boolean |
shutdown(Log server_log)
GenericHandler doesn't do anything in the shutdown() method, either. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected HandlerData hd
protected java.lang.String[] url_tokens
protected java.lang.String handler_uri
protected FormData form_data
protected java.util.Hashtable steam_vars
protected User user
protected Session session
protected java.sql.Connection conn
protected boolean already_displayed_page
public static final int ERROR
public static final int WARNING
public static final int NORMAL
public static final int DEBUG
Constructor Detail |
public GenericHandler()
Method Detail |
public void handleRequest(HandlerData hd)
public boolean init(Log server_log)
public boolean shutdown(Log server_log)
public void log(int log_level, java.lang.String log_message)
public void handleException(java.lang.Exception exception, java.lang.String short_code)
public void logEvent(java.lang.String major, java.lang.String minor, java.lang.String data)
public void displayString(java.lang.String message)
public java.lang.String displayPage(java.lang.String document_path, java.util.Hashtable steam_vars)
public void sayBadURL()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |