public class Router
extends HttpServlet
InitInstance class is called.
RouteHandler implementor found through a lookup in the {link GAEL.Config#getHandler}
| Modifier and Type | Field and Description |
|---|---|
static int |
krGET |
static int |
krPOST |
static int |
krPUT |
int |
nCtr |
| Constructor and Description |
|---|
Router() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Not implemented.
|
void |
doGet(HttpServletRequest oReq,
HttpServletResponse oRes)
Internally the request is routed to handleRequest where it is routed to the appropriate
RouteHandler. |
void |
doPost(HttpServletRequest oReq,
HttpServletResponse oRes)
Internally the request is routed to handleRequest where it is routed to the appropriate
RouteHandler. |
void |
init(ServletConfig oCfg)
Called when the servlet needs initialization (on a cold start).
|
boolean |
isDevp() |
void |
jsonOutput(HttpServletResponse oRes,
java.lang.String sJsonStr)
Called by
RouteHandlers to create a application/json response. |
void |
log(java.lang.String sMsg) |
void |
sendResponseError(HttpServletRequest oReq,
HttpServletResponse oRes,
int nCode,
java.lang.String sError)
Used to send a failure code to the client
|
void |
sendResponseError(Req oR,
int nCode,
java.lang.String sError)
Used to send an error to the client
|
void |
sendResponseErrorTrace(java.lang.Exception e,
Req oR,
HttpServletResponse oRes,
int nCode,
java.lang.String sError)
Used to send an execption with trace information to the client
|
public static final int krGET
public static final int krPOST
public static final int krPUT
public int nCtr
public void log(java.lang.String sMsg)
public boolean isDevp()
public void init(ServletConfig oCfg)
throws ServletException
oCfg - ServletException - - when the InitInstance failspublic void doPost(HttpServletRequest oReq,
HttpServletResponse oRes)
throws java.io.IOException
RouteHandler.oReq - Standard servlet request parametersoRes - Standard servlet response parametersjava.io.IOExceptionpublic void doGet(HttpServletRequest oReq,
HttpServletResponse oRes)
throws java.io.IOException
RouteHandler.oReq - Standard servlet request parametersoRes - Standard servlet response parametersjava.io.IOExceptionpublic void jsonOutput(HttpServletResponse oRes,
java.lang.String sJsonStr)
throws java.io.IOException
RouteHandlers to create a application/json response.oRes - standard servlet response parameterssJsonStr - JSON formatted string to be returnedjava.io.IOExceptionpublic void sendResponseError(Req oR, int nCode, java.lang.String sError) throws java.io.IOException
oR - nCode - sError - java.io.IOExceptionpublic void sendResponseError(HttpServletRequest oReq,
HttpServletResponse oRes,
int nCode,
java.lang.String sError)
throws java.io.IOException
oReq - oRes - nCode - sError - java.io.IOExceptionpublic void sendResponseErrorTrace(java.lang.Exception e,
Req oR,
HttpServletResponse oRes,
int nCode,
java.lang.String sError)
throws java.io.IOException
e - oR - oRes - nCode - sError - java.io.IOExceptionpublic void destroy()