Skip to content

Instantly share code, notes, and snippets.

@pgordon9
Last active March 4, 2017 16:06
Show Gist options
  • Save pgordon9/5243c8a4c89574c0c5927fcd21f889f1 to your computer and use it in GitHub Desktop.
Save pgordon9/5243c8a4c89574c0c5927fcd21f889f1 to your computer and use it in GitHub Desktop.
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