public class VibeServlet extends HttpServlet
HttpServletRequest and HttpServletResponse
into ServerHttpExchange. When you configure servlet, you must set
asyncSupported to true
.
Servlet servlet = new VibeServlet().httpAction(http -> {});
ServletRegistration.Dynamic reg = context.addServlet(VibeServlet.class.getName(), servlet);
reg.setAsyncSupported(true);
reg.addMapping("/vibe");
| Constructor and Description |
|---|
VibeServlet() |
| Modifier and Type | Method and Description |
|---|---|
VibeServlet |
httpAction(Action<ServerHttpExchange> action)
Registers an action to be called when
ServerHttpExchange is
available. |
protected void |
service(HttpServletRequest req,
HttpServletResponse resp) |
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, servicedestroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, logprotected void service(HttpServletRequest req, HttpServletResponse resp)
service in class HttpServletpublic VibeServlet httpAction(Action<ServerHttpExchange> action)
ServerHttpExchange is
available.Copyright 2014, The Vibe Project