REST with SpringMVC 3
I know JavaEE is hot and Spring is Old-School! So, it’s the best time to talk about one component in SpringMVC 3 that I find quite nice & useful.
REST (REpresentational State Transfer) , as a Resource Oriented Architecture interested me specially for the URI functionalities. RESTful features in Spring MVC 3.0 are very convenient for that purpose.
You can manage your url directly within your controller. Thus, you can get as close as you want to your business terms within the url:
@Controller
public class ProjectController {
...
@RequestMapping("/{section}/{project}/index.html")
public String getProject(@PathVariable String section, @PathVariable String project, Model model) {
...
}
}
See also : rest-in-spring-3-mvc
See also RestTemplate : rest-in-spring-3-resttemplate