“Spring Serve Robots.txt” Kode Jawaban

Spring Serve Robots.txt

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.authorizeRequests()
            .antMatchers("/robots.txt").permitAll()
    }
vmxes

Spring Serve Robots.txt


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

Breakable Batfish

Jawaban yang mirip dengan “Spring Serve Robots.txt”

Pertanyaan yang mirip dengan “Spring Serve Robots.txt”

Lebih banyak jawaban terkait untuk “Spring Serve Robots.txt” di Java

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya