I am trying to give access to robots.txt in Spring-MVC. To test the code, I put robots.txt in WebContent,Root and W
robots.txt
WebContent
Root
W
This works for me:
Put robots.txt directly under webapp
webapp
In mvc-dispatcher-servlet.xml have:
mvc-dispatcher-servlet.xml
<mvc:default-servlet-handler/>
<mvc:resources mapping="/resources/**" location="/, classpath:/META-INF/web-resources/" />
Use maven to build your war