Spring 2 MVC and ResourceBundleViewResolver problem
Contents
This one took some time to figure out - it is one of those problems that are obvious after you know the solution but hard to see beforehand.
I had the ResourceBundleViewResolver configured with Tiles 2, like this:
[code language='xml']
[/code]
and the view.properties was:
[code language='xml']
parent-view.(class)=org.springframework.web.servlet.view.JstlView
parent-view.(abstract)=true
about.url=/WEB-INF/jsp/about.jsp
form.url=/WEB-INF/jsp/form.jsp
list.url=/WEB-INF/jsp/list.jsp
[/code]
It kept givin exception saying that /WEB-INF/jsp/list.jsp does not exist. Which it did. I tried couple of things, no result.
The problem was in trailing space AFTER list.jsp, therefore the path to JSP file searched for was "/WEB-INF/jsp/list.jsp ", not "/WEB-INF/jsp/list.jsp".
Not sure if this is bug or feature - but removing trailing spaces should really be a sensible thing to do. As I found afterwards, the problem exists since 2005 - see this and this.
Author Miro Adamy
LastMod 2008-01-24
License (c) 2006-2020 Miro Adamy