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 -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -