Spring / Spring Interview questions II
Where do I place the robots.txt or sitemap.xml or any other file in my web application?
Place the file at the context root of the application.
All urls are handled by Spring MVC DelegatingFilterProxy , so we need to exclude *.txt, *.xml from this filter. To exclude,
<mvc:resources mapping="/robots.txt" location="/WEB-INF/robots.txt" order="0"/> <mvc:resources mapping="/sitemap.xml" location="/WEB-INF/sitemap.xml" order="0"/>
More Related questions...