I have a controller with @RequestMapping
for root path "/"
. There are other controllers with say a @RequestMapping
of "/test"
etc. My application seems to be mapping correctly for paths like /appname/test
, but if I add a trailing slash to the path, like so "/appname/test/
then it maps to the controller that has the @RequestMapping
for root path "/"
. Any idea why?
Update:
I also tried removing <mvc:annotation-driven />
and replacing with
<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"
p:order="0" p:alwaysUseFullPath="true" />
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"
p:alwaysUseFullPath="true"/>
That fixed the trailing slash problem, but my validations stopped working