public class ActionServlet<HE extends HttpExchange>
extends javax.servlet.http.HttpServlet
| Constructor and Description |
|---|
ActionServlet() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterAction(HE exchange)
Called after an action.
|
protected void |
beforeAction(HE exchange)
Called before an action.
|
protected HE |
getHttpExchange(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Returns the HTTP exchange used by this servlet.
|
protected void |
onClientError(HE exchange,
ClientException error)
Called upon a error thrown due to client request.
|
protected void |
onInit()
Called during servlet initialization.
|
protected void |
onNotFound(HE exchange)
Called upon endpoint not found.
|
protected boolean |
onUncaughtError(HE exchange,
Throwable throwable)
Called when an uncaught error happens while processing an action.
|
protected void |
registerAction(HttpMethod method,
String path,
Action action)
Register an action
|
protected void |
service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, serviceprotected void onInit()
protected void onNotFound(HE exchange) throws javax.servlet.ServletException, IOException
exchange - HTTP exchange. Default implementation sends a HttpServletResponse.SC_NOT_FOUND status.IOException - if an input or output error occurs while the servlet is handling the HTTP request.javax.servlet.ServletException - if the HTTP request cannot be handled.protected boolean onUncaughtError(HE exchange, Throwable throwable) throws javax.servlet.ServletException, IOException
exchange - HTTP exchange.throwable - error.IOException - if an input or output error occurs while the servlet is handling the HTTP request.javax.servlet.ServletException - if the HTTP request cannot be handled.protected void onClientError(HE exchange, ClientException error) throws javax.servlet.ServletException, IOException
exchange - HTTP exchange. Default implementation sends a 4XX status according to given exception.IOException - if an input or output error occurs while the servlet is handling the HTTP request.javax.servlet.ServletException - if the HTTP request cannot be handledprotected void registerAction(HttpMethod method, String path, Action action)
method - HTTP methodpath - path relative to this provider Servlet mappingaction - action associated with given parameters.protected void beforeAction(HE exchange) throws javax.servlet.ServletException, IOException
SecurityManager). Default implementation does nothing.exchange - HTTP exchange.IOException - if an input or output error occurs while the servlet is handling the HTTP request.javax.servlet.ServletException - if the HTTP request cannot be handled.protected void afterAction(HE exchange) throws javax.servlet.ServletException, IOException
SecurityManager), and the action was successfully processed. Default implementation does nothing.exchange - HTTP exchange.IOException - if an input or output error occurs while the servlet is handling the HTTP request.javax.servlet.ServletException - if the HTTP request cannot be handled.protected HE getHttpExchange(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
req - HTTP request.resp - HTTP response.protected final void service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
IOException
service in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionIOExceptionCopyright © 2016 Agapsys Tecnologia Ltda-ME. All rights reserved.