Created
June 15, 2016 14:33
-
-
Save grahamoregan/3c4ab889cfedc99f3de3075ceac007a6 to your computer and use it in GitHub Desktop.
Dropwizard register servlet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ServletHolder holder = new ServletHolder(new HttpServlet() { | |
@Override | |
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { | |
resp.getWriter().print("pong"); | |
resp.getWriter().close(); | |
} | |
}); | |
environment.getApplicationContext().getServletHandler().addServletWithMapping(holder, "/servlet/ping"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment