public abstract class JSONServlet extends javax.servlet.http.HttpServlet implements RequestParser, ResponseBuilder
HttpServlet by providing a nicer way to read/write request/response data.gson| Constructor and Description |
|---|
JSONServlet() |
| Modifier and Type | Method and Description |
|---|---|
protected Response |
delete(Request request)
Implements the DELETE method.
|
protected void |
doDelete(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
protected void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
protected void |
doOptions(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
protected void |
doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
protected void |
doPut(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
protected Response |
get(Request request)
Implements the GET method.
|
protected Response |
post(Request request)
Implements the POST method.
|
protected Response |
put(Request request)
Implements the PUT method.
|
doHead, doTrace, getLastModified, service, servicedestroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, logclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfromJson, fromJson, getPathInfoAcceptedResponse, CreatedResponse, EmptyResponse, ErrorResponse, ErrorResponse, ErrorResponseMissingPath, ErrorResponseNotFound, ErrorResponseResourceAlreadyExists, ErrorResponseUnsupportedOperation, ObjectResponse, ObjectResponse, writeResponse, writeResponseprotected final void doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
IOException
doGet in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionIOExceptionprotected final void doDelete(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
IOException
doDelete in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionIOExceptionprotected final void doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
IOException
doPost in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionIOExceptionprotected final void doPut(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
IOException
doPut in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionIOExceptionprotected final void doOptions(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
IOException
doOptions in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionIOExceptionprotected Response get(Request request) throws javax.servlet.ServletException, IOException
request - The request datajavax.servlet.ServletExceptionIOExceptionprotected Response delete(Request request) throws javax.servlet.ServletException, IOException
request - The request datajavax.servlet.ServletExceptionIOExceptionprotected Response post(Request request) throws javax.servlet.ServletException, IOException
request - The request datajavax.servlet.ServletExceptionIOExceptionprotected Response put(Request request) throws javax.servlet.ServletException, IOException
request - The request datajavax.servlet.ServletExceptionIOExceptionCopyright © 2016, Peter Nerg Apache License v2.0