public abstract class JSONRPC2Servlet extends javax.servlet.http.HttpServlet
HTTP POST endpoint
and passed to
service
for processing. The HTTP GET endpoint
prints out a banner text message
that identifies the
web service name and version and lists the supported JSON-RPC 2.0 requests.
Inheriting servlets must initialise all protected members in their
init(...)
method.
Modifier and Type | Field and Description |
---|---|
protected Banner |
banner
The Connect2id service banner, printed at the HTTP GET endpoint.
|
protected String |
responseContentType
The HTTP (POST) response content type of JSON-RPC 2.0 responses.
|
protected RequestHandlerWithLifecycle |
service
The target JSON-RPC 2.0 service.
|
protected String |
wsName
The web service name.
|
protected String |
wsVersion
The web service version.
|
Constructor and Description |
---|
JSONRPC2Servlet() |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Called at servlet shutdown.
|
void |
doGet(javax.servlet.http.HttpServletRequest httpRequest,
javax.servlet.http.HttpServletResponse httpResponse)
Outputs a simple text/plain banner message that identifies the
Connect2id web service name/version and lists the supported JSON-RPC
2.0 requests.
|
void |
doPost(javax.servlet.http.HttpServletRequest httpRequest,
javax.servlet.http.HttpServletResponse httpResponse)
Receives JSON-RPC 2.0 requests for the Connect2id service by means
of HTTP POST.
|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
protected RequestHandlerWithLifecycle service
protected String responseContentType
public JSONRPC2Servlet()
public void doPost(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse) throws javax.servlet.ServletException
doPost
in class javax.servlet.http.HttpServlet
httpRequest
- The HTTP request.httpResponse
- The output HTTP response.javax.servlet.ServletException
- On a request handling exception.public void doGet(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse) throws javax.servlet.ServletException
doGet
in class javax.servlet.http.HttpServlet
httpRequest
- The HTTP request.httpResponse
- The output HTTP response.javax.servlet.ServletException
- On a request handling exception.public void destroy()
destroy
in interface javax.servlet.Servlet
destroy
in class javax.servlet.GenericServlet
Copyright © 2015 Connect2id. All Rights Reserved.