View resolvers include context in path
Hello,
I'm trying to develop a simple MVC app to understand how everything is put together.
I've a problem in the line of this thread:
http://forum.springsource.org/showth...apping-problem
The fact being that depending on url-pattern I use in web.xml while the correct method of the controller is called correctly, the view that is looked for changes, addind in some cases the context path to it.
For example, with this patterns:
Code:
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
Everything works fine, and (for example) to a certain request the jsp view used is "/WEB-INF/jsp/test.jsp".
While if I use:
Code:
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/dir/*</url-pattern>
</servlet-mapping>
The view that Spring tries to use becomes: "/mywebapp/WEB-INF/jsp/test.jsp" that of course is wrong.
On the before mentioned thread you can see the error (mine is completely the same):
Code:
09:52:26 WARN org.springframework.web.servlet.PageNotFound[noHandlerFound] - No mapping for [/myspringmvc/WEB-INF/view/index.jsp] in DispatcherServlet with name 'webapp'
Any hint on why this strange behavior?
I know that as a workaround I can map / to the dispatcher, but I really would like to understand the issue, it seems like a bug to me.