Package com.exedio.cops
Class CopsServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- com.exedio.cops.CopsServlet
-
- All Implemented Interfaces:
Serializable
,Servlet
,ServletConfig
- Direct Known Subclasses:
PropertiesServlet
public abstract class CopsServlet extends HttpServlet
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
ENCODING
Deprecated.UseCharsetName.UTF8
insteadstatic String
UTF8
Deprecated.UseCharsetName.UTF8
instead
-
Constructor Summary
Constructors Modifier Constructor Description protected
CopsServlet()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
doGet(HttpServletRequest request, HttpServletResponse response)
protected void
doPost(HttpServletRequest request, HttpServletResponse response)
protected abstract void
doRequest(HttpServletRequest request, HttpServletResponse response)
static String
getAuthentication(HttpServletRequest request)
protected String
getResourcesRootPath()
Returns the path all resources are available under.void
init(ServletConfig config)
void
printException(PrintStream out, Exception exception)
void
printException(StringBuilder out, Exception exception)
static String
report(HttpServletRequest request)
String
reportException(Exception exception)
Deprecated.UsereportException(HttpServletRequest, Exception)
instead.String
reportException(HttpServletRequest request, Exception exception)
Returns the id under with the exception has been reported in the log.protected boolean
suppressPathCheck()
Overwrite this method (and return true) if your CopsServlet is not mounted at ".../*" and you know what you're doing.-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
-
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
-
-
-
Field Detail
-
ENCODING
@Deprecated public static final String ENCODING
Deprecated.UseCharsetName.UTF8
instead- See Also:
- Constant Field Values
-
UTF8
@Deprecated public static final String UTF8
Deprecated.UseCharsetName.UTF8
instead- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init(ServletConfig config) throws ServletException
- Specified by:
init
in interfaceServlet
- Overrides:
init
in classGenericServlet
- Throws:
ServletException
-
suppressPathCheck
protected boolean suppressPathCheck()
Overwrite this method (and return true) if your CopsServlet is not mounted at ".../*" and you know what you're doing.
-
getResourcesRootPath
protected String getResourcesRootPath()
Returns the path all resources are available under. The default implementation returns "resources". Must not return null or empty string.
-
doGet
protected final void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
- Overrides:
doGet
in classHttpServlet
- Throws:
ServletException
IOException
-
doPost
protected final void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
- Overrides:
doPost
in classHttpServlet
- Throws:
ServletException
IOException
-
doRequest
protected abstract void doRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
- Throws:
ServletException
IOException
-
getAuthentication
public static final String getAuthentication(HttpServletRequest request)
-
printException
public final void printException(PrintStream out, Exception exception)
-
printException
public final void printException(StringBuilder out, Exception exception)
-
reportException
public final String reportException(HttpServletRequest request, Exception exception)
Returns the id under with the exception has been reported in the log.
-
report
public static final String report(HttpServletRequest request)
-
reportException
@Deprecated public final String reportException(Exception exception)
Deprecated.UsereportException(HttpServletRequest, Exception)
instead.
-
-