Что-то мне подсказывает, что дело в http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/web/servlet/view/ContentNegotiatingViewResolver.html
| Цитата | | Implementation of ViewResolver that resolves a view based on the request file name or Accept header. |
Вот немного информации об нем - http://static.springsource.org/spring/docs/current/spring-framework-reference/html/mvc.html#mvc-multiple-representations
| Цитата | | In the above configuration, if a request is made with an .html extension, the view resolver looks for a view that matches the text/html media type. The InternalResourceViewResolver provides the matching view for text/html. If the request is made with the file extension .atom, the view resolver looks for a view that matches the application/atom+xml media type. This view is provided by the BeanNameViewResolver that maps to the SampleContentAtomView if the view name returned is content. If the request is made with the file extension .json, the MappingJacksonJsonView instance from the DefaultViews list will be selected regardless of the view name. Alternatively, client requests can be made without a file extension but with the Accept header set to the preferred media-type, and the same resolution of request to views would occur. |
Значит нужно каким-то образом добавить в него резолвер для txt.
При таком маппинге
Цитата(m0zg @ 27.11.2011, 21:47 ) | @RequestMapping(value = "/robots", method = RequestMethod.GET) public String robots() { return "robots"; } |
По запросу /robots.txt что-нибудь возвращается? Или 404?
|