Notes to a newbie spring-mvc developer
-
Activate log4j. Without it you’re lost
-
Look through the log to see if you’re getting the RequestMapping through Spring.
-
If you are not despite correct annotations, see this post. In particular if you’ve got Spring Security installed, for Goodness sake, don’t forget these lines:
<beans:bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
<beans:bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
</beans:bean>
</beans:bean>
- Just in case you decided to change the mappings, and you continue to see the old ones in the logs, clean and rebuild.
First published here