Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.yammer.metrics.reporting;
 
An HTTP servlet which outputs a text/plain "pong" response.
public class PingServlet extends HttpServlet {
    private static final String CONTENT_TYPE = "text/plain";
    private static final String CONTENT = "pong";
    @Override
    protected void doGet(HttpServletRequest req,
                         HttpServletResponse respthrows ServletExceptionIOException {
        resp.setStatus(.);
        resp.setHeader("Cache-Control""must-revalidate,no-cache,no-store");
        resp.setContentType();
        final PrintWriter writer = resp.getWriter();
        try {
            writer.println();
        } finally {
            writer.close();
        }
    }
New to GrepCode? Check out our FAQ X