Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ResetServlet. JettyExample | parkergordon.io
{...}
object JettyExample{
{...}
object CounterServlets{
{...}
class ResetServlet extends HttpServlet {
override protected def doGet(request: HttpServletRequest, response: HttpServletResponse):Unit = {
requestCount.getAndIncrement()
response.setContentType("text/html")
response.setStatus(HttpServletResponse.SC_OK)
response.getWriter().println(s"<h2>Counter reset to 0.</h2>")
}
}
}
}
@pgordon9
Copy link
Author

pgordon9 commented Mar 4, 2017

updated to act on AtomicInteger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment