I'm starting a new project with Spring 3.1, and have been eyeball deep in all the documentation and forum opinions about how to use the @Controller annotation.
I personally dislike using annotations for MVC; I much prefer having all the URLs of a webapp available in one place, using SimpleUrlHandlerMapping.
Also, from much previous work using Spring 2.x, I'm very used to the BaseCommandController heirarchy.
I've always loved Spring because it's empowering without being restricting. Now I find Spring MVC is forcing me to put URLs into the java source, meaning (a) I can't map a controller to several URLs, and (b) to discover what URLs are in use in a webapp, I have to scan through different java source files, which I find impractical.
What is the recommended way of combining @Controller with SimpleUrlHandlerMapping, please ?
Update:
Hi Dave, are you saying you can map multiple URLs like this (altered from petclini.web.ClinicController)?
@RequestMapping({"/vets", "/another"})
public ModelMap vetsHandler() {
If this works then good.
My question still stands though: If I don't want URLs in my java source, how best to map them with @Controller classes?
Regards,