|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Framework for handling template requests, requested by reactor. Anything which implements this interface can be used as a handler to process web requests.
How to use:
When a request comes in, WebMacro loads the handler that matches the script name of the request. It will search the ClassPath looking for a script with the same fully qualified name as the script name, which more or less means your handler should probably not be in any particular package.
Method Summary | |
Template |
accept(WebContext contextData)
This is the primary method you override to create a new handler. |
void |
destroy()
You may use this method to save persistent state on exit. |
void |
init()
Use this method to run any startup initialization that you need to perform. |
java.lang.String |
toString()
You SHOULD override this method and provide a short name by which your handler is known. |
Method Detail |
public Template accept(WebContext contextData) throws HandlerException
If you throw an Exception it will be used to provide an explanation to the user of why the failure occurred. The HandlerException class provides you with numerous options for reporting errors.
contextData
- contains information about this connection
HandlerException
- if something went wrong with the handlerpublic void init() throws HandlerException
HandlerException
- if the handler failed to initializepublic java.lang.String toString()
public void destroy()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |