java - I cannot access Robots.txt in Spring-MVC -


i trying give access robots.txt in spring-mvc. test code, put robots.txt in webcontent,root , web-inf cannot access of them.

i've applied answers of these questions 1,2,3 no avail.

mycode

<mvc:resources mapping="/resources/**" location="/resources/" /> <mvc:resources mapping="/robots.txt" location="/robots.txt" order="0" /> <mvc:annotation-driven /> 

this works me:

put robots.txt directly under webapp

in mvc-dispatcher-servlet.xml have:

<mvc:default-servlet-handler/>

<mvc:resources mapping="/resources/**" location="/, classpath:/meta-inf/web-resources/" />

use maven build war


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -