Package prompto.server
Class CleverServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- prompto.server.CleverServlet
-
- All Implemented Interfaces:
Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
- Direct Known Subclasses:
BinaryServlet,ControlServlet,DataServlet,DebugRequestServlet,GraphQLServlet,PromptoServlet,ResourceServlet,StoreServlet,UserServlet
public class CleverServlet extends javax.servlet.http.HttpServlet- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static ThreadLocal<javax.servlet.http.HttpServletRequest>CURRENT_REQUESTstatic ThreadLocal<javax.servlet.http.HttpServletResponse>CURRENT_RESPONSEstatic ThreadLocal<String>REGISTERED_ORIGINS
-
Constructor Summary
Constructors Constructor Description CleverServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetServletName()protected Map<String,byte[]>readPartsAsBytes(javax.servlet.http.HttpServletRequest req)protected Map<String,Object>readPartsAsObjects(javax.servlet.http.HttpServletRequest req)protected voidservice(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)voidsetHolder(org.eclipse.jetty.servlet.ServletHolder holder)voidsetMultipartConfig(javax.servlet.MultipartConfigElement config)protected voidwriteJSONError(String message, javax.servlet.ServletOutputStream output)protected voidwriteJsonResponseError(String error, OutputStream output)protected voidwriteJSONResult(Object result, OutputStream output)-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
-
-
-
-
Field Detail
-
REGISTERED_ORIGINS
public static ThreadLocal<String> REGISTERED_ORIGINS
-
CURRENT_REQUEST
public static ThreadLocal<javax.servlet.http.HttpServletRequest> CURRENT_REQUEST
-
CURRENT_RESPONSE
public static ThreadLocal<javax.servlet.http.HttpServletResponse> CURRENT_RESPONSE
-
-
Method Detail
-
getServletName
public String getServletName()
- Specified by:
getServletNamein interfacejavax.servlet.ServletConfig- Overrides:
getServletNamein classjavax.servlet.GenericServlet
-
service
protected void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException- Overrides:
servicein classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
setHolder
public void setHolder(org.eclipse.jetty.servlet.ServletHolder holder)
-
setMultipartConfig
public void setMultipartConfig(javax.servlet.MultipartConfigElement config)
-
writeJSONError
protected void writeJSONError(String message, javax.servlet.ServletOutputStream output) throws IOException
- Throws:
IOException
-
writeJSONResult
protected void writeJSONResult(Object result, OutputStream output) throws IOException
- Throws:
IOException
-
readPartsAsObjects
protected Map<String,Object> readPartsAsObjects(javax.servlet.http.HttpServletRequest req) throws javax.servlet.ServletException, IOException
- Throws:
javax.servlet.ServletExceptionIOException
-
readPartsAsBytes
protected Map<String,byte[]> readPartsAsBytes(javax.servlet.http.HttpServletRequest req) throws javax.servlet.ServletException, IOException
- Throws:
javax.servlet.ServletExceptionIOException
-
writeJsonResponseError
protected void writeJsonResponseError(String error, OutputStream output) throws IOException
- Throws:
IOException
-
-