@Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        if ("/robots.txt".equals(request.getPathInfo())) {
            String serverName = request.getServerName();
            byte[] robotsTxt = null;
            if (hostMatch(GENERIC_HOST, serverName)) {
                robotsTxt = GENERIC_ROBOTS_TXT;
            } else if (hostMatch(HTML5_HOST, serverName)) {
                robotsTxt = HTML5_ROBOTS_TXT;
            } else if (hostMatch(PARSETREE_HOST, serverName)) {
                robotsTxt = PARSETREE_ROBOTS_TXT;
            } else {
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
                return;
            }
            writeResponse(robotsTxt, "text/plain; charset=utf-8", response);
            return;
        } else if ("/style.css".equals(request.getPathInfo())) {
            writeResponse(STYLE_CSS, "text/css; charset=utf-8", response);
            return;
        } else if ("/script.js".equals(request.getPathInfo())) {
            writeResponse(SCRIPT_JS, "text/javascript; charset=utf-8", response);
            return;
        } else if ("/icon.png".equals(request.getPathInfo())) {
            writeResponse(ICON_PNG, "image/png", response);
            return;
        } else if ("/about.html".equals(request.getPathInfo())) {
            writeResponse(ABOUT_HTML, "text/html; charset=utf-8", response);
            return;
        } else if (Statistics.STATISTICS != null && "/stats.html".equals(request.getPathInfo())) {
            Statistics.STATISTICS.writeToResponse(response);
            return;
        }
        doPost(request, response);
    }
@ Override protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { if ( "/robots.txt" . equals ( request . getPathInfo ( ) ) ) { String serverName = request . getServerName ( ) ; byte [ ] robotsTxt = null ; if ( hostMatch ( GENERIC_HOST , serverName ) ) { robotsTxt = GENERIC_ROBOTS_TXT ; } else if ( hostMatch ( HTML5_HOST , serverName ) ) { robotsTxt = HTML5_ROBOTS_TXT ; } else if ( hostMatch ( PARSETREE_HOST , serverName ) ) { robotsTxt = PARSETREE_ROBOTS_TXT ; } else { response . sendError ( HttpServletResponse . SC_NOT_FOUND ) ; return ; } writeResponse ( robotsTxt , "text/plain; charset=utf-8" , response ) ; return ; } else if ( "/style.css" . equals ( request . getPathInfo ( ) ) ) { writeResponse ( STYLE_CSS , "text/css; charset=utf-8" , response ) ; return ; } else if ( "/script.js" . equals ( request . getPathInfo ( ) ) ) { writeResponse ( SCRIPT_JS , "text/javascript; charset=utf-8" , response ) ; return ; } else if ( "/icon.png" . equals ( request . getPathInfo ( ) ) ) { writeResponse ( ICON_PNG , "image/png" , response ) ; return ; } else if ( "/about.html" . equals ( request . getPathInfo ( ) ) ) { writeResponse ( ABOUT_HTML , "text/html; charset=utf-8" , response ) ; return ; } else if ( Statistics . STATISTICS != null && "/stats.html" . equals ( request . getPathInfo ( ) ) ) { Statistics . STATISTICS . writeToResponse ( response ) ; return ; } doPost ( request , response ) ; }
@see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)