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
Post a Comment