Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

spring serve robots.txt


@RequestMapping(value = "/robots.txt")
public void robots(HttpServletRequest request, HttpServletResponse response) {
    try {
        response.getWriter().write("User-agent: *
Disallow: /
");
    } catch (IOException e) {
        CustomLogger.info(TAG, "robots", "robots(): "+e.getMessage());
    }
}

Source by codefantasy.org #
 
PREVIOUS NEXT
Tagged: #spring #serve
ADD COMMENT
Topic
Name
4+3 =