Hi,
I’m using Spring 3.0 to rewrite existing application. However, I’m having some problems with appropriate handler mappings.
I have defined the following controllers:
applicationContext-mvc.xml (used by web.xml, DispatcherServlet):Code:@Controller public class CarsController { @RequestMapping("/cars") public void handleRequest(Model model, HttpServletRequest r) throws Exception { .. } } @Controller public class CarDetailsController { @RequestMapping("/cars/{id}_{model}") public void handleRequest(Model model, HttpServletRequest r) throws Exception { .. } }
The problem is that I want CarsController to handle ONLY this url "/cars", without those mappings : [/cars.*] , [/cars/]Code:<context:component-scan base-package="org.xxx.*" /> <mvc:annotation-driven />
The other mappings matching ONLY this pattern /cars/{id}_{model} should be handled by CarDetailsController.
I would really appreciate any help that can help me to configure controllers to handle only given pattern.
Regards,
Michal


Reply With Quote
