I created Spring MVC with Tiles project.
My controller returns a string "hello" which is a logical file name and I have jsp called as hello.jsp.
In tiles.xml I should have a definition named hello which extends a definition template. My basic definition is mapped to layout.jsp.
When I add the jspViewResolver, it takes me to hello.jsp, but if I comment it out it takes me to layout.jsp which is rendered based on the definition of hello in tiles.xml.
So, why we shouldn't have both jspViewResolver and tilesViewResolver together?
UrlBasedViewResolver
which simple construct a URL regardless of the actually existence of the view being request. OtherViewResolver
like theBeanNameViewResolver
don't return a view when it doesn't exists. Having multipleUrlBasedViewResolver
s in your view resolver chain will make the last ones never called. As explained in the documentation of the class. – M. Deinum