|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.servlet.GenericServlet | +--javax.servlet.http.HttpServlet | +--com.isomorphic.servlet.BaseServlet | +--com.isomorphic.servlet.IDACall
This servlet handles built-in SmartClient datasource operations by default. It is configured as the default actionURL for the RPCManager on the client-side. You can extend this class and use the API hooks provided here to do something custom, like Authentication/Authorization checks.
Method Summary | |
DSResponse |
handleDSRequest(DSRequest dsRequest,
RPCManager rpc,
RequestContext context)
This method is called by processRequest() to handle a DSRequest sent from the client. |
RPCResponse |
handleRPCRequest(RPCRequest rpcRequest,
RPCManager rpc,
RequestContext context)
This method is called by processRequest() to handle a RPCRequest sent from the client. |
void |
processRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Servlet entry point to process the request. |
Method Detail |
public void processRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
request
- The HttpServletRequestresponse
- The HttpServletResponsejavax.servlet.ServletException
- As per HttpServlet.service()java.io.IOException
- As per HttpServlet.service()public DSResponse handleDSRequest(DSRequest dsRequest, RPCManager rpc, RequestContext context) throws java.lang.Exception
The default implementation of this method simply does this:
try { return dsRequest.execute(); } catch (Exception e) { DSResponse dsResponse = new DSResponse(); context.staticLog.warn("dsRequest.execute() failed: ", e); dsResponse.setStatus(DSResponse.STATUS_FAILURE); dsResponse.setData(e.getMessage()); return dsResponse; }
dsRequest
- The DSRequest to processRPCmanager
- The RPCManager that was used to demultiplex the DSRequestRequestContext
- RequestContext class provides accessors to Servlet basics like
HttpServletRequest, HttpServletResponsejava.lang.Exception
- If an error occurs. If possible, you should wrap any error in a
DSResponse with an error status code and handle it on the client.public RPCResponse handleRPCRequest(RPCRequest rpcRequest, RPCManager rpc, RequestContext context) throws java.lang.Exception
The default implementation of this method simply does this:
try { return rpcRequest.execute(); } catch (Exception e) { context.staticLog.warn("rpcRequest.execute() failed: ", e); RPCResponse rpcResponse = new RPCResponse(); rpcResponse.setStatus(RPCResponse.STATUS_FAILURE); rpcResponse.setData(e.getMessage()); return rpcResponse; }
dsRequest
- The DSRequest to processRPCmanager
- The RPCManager that was used to demultiplex the DSRequestRequestContext
- RequestContext class provides accessors to Servlet basics like
HttpServletRequest, HttpServletResponsejava.lang.Exception
- If an error occurs. If possible, you should wrap any error in a
RPCResponse with an error status code and handle it on the client.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |