Parameterized REST URLs with Spring MVC
I’ve been using Spring now for quite some time. Since the 1.0 days. With the rise of REST, one of the things that bugs me with Spring MVC is how to map REST standard URLS.
Thanks to Carbon Five, we can:
Mapping your URLS to controllers is straighforward and powerful. URLs look like:
/view/noparameters /view/(bar:foo) /view/(*.html:html) /view/(**/*:view).view /view/c/(*:controller)/(*:id)
What ever is after the : is the name of the variable that gets stored in your http parameter map. Your controller doesn’t have to know anything about the URL coming in. Much better, huh?
I’ve been using this in both of my commercial products for quite some time. Until Spring 3 makes its way to a stable state, I’ll continue to use it. Very handy.