Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

spring serve robots.txt

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

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());
    }
}

Comment

PREVIOUS NEXT
Code Example
Java :: Which API provides a lightweight solution for GUI components? 
Java :: java convert double to string 
Java :: org.sonar.java.AnalysisException: Please provide compiled classes of your project with sonar.java.binaries property 
Java :: list to lowercase java 
Java :: android studio print console 
Java :: youTubeInitializationResult gives SERVICE_MISSING error in android 
Java :: absolute method in jdbc 
Java :: number regex java 
Java :: list java processes 
Java :: open a new activity on click of a button 
Java :: button background color not changing android 
Java :: programmation android avoir acces à la liste des intents de partage 
Java :: localdatetime to timestamp 
Java :: how to create textview programmatically in android 
Java :: android highlight part of textview 
Java :: java actionlistener 
Java :: jdbc driver servertimezone configuration property 
Java :: how to get the dimensions of a 2d array in java 
Java :: java max integer 
Java :: java get distinct values from list 
Java :: java switch 
Java :: last day of month from localdate java 
Java :: how to find a specific word in a text file in java 
Java :: spigot execute command as player 
Java :: print line in jjava 
Java :: why to use serializable with java bean 
Java :: java 8 group a collections by 2 property 
Java :: char equals java 
Java :: test if string is float java 
Java :: What is null mean in java 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =