To perform different ways of URL mapping to types of HTTP request handlers, follow these steps:
- Since ch03 is a working project already, let us add a simple controller, SimplePatternsController, with three handler methods handling GET and POST transactions inside the org.packt.dissect.mvc.controller package. This simple controller has both the class-level and method-level @RequestMapping annotations, through which the request URLs will be determined based on the class level going down to the URL of its respective handler methods:
@Controller @RequestMapping("/simple") public class SimplePatternsController { @RequestMapping(value="/form_upload_get.html", method=RequestMethod.GET) public String uploadFileFormGet(Model model) ...