title: How to optimize my code in Spring MVC Controller using @RequestMapping?
body: <p>In my controller,My controller method names are equals to the requestmapping url.For example,<code>/list</code> is equal to method name <code>list</code>. Is there has a common handler method to short my code?I do not want to write every controller and method in these way.I remember that .net mvc has a comom way to config it.What about Spring MVC?</p>
  
  <pre><code>@Controller
  @RequestMapping(value = "/fooController ")
  public class FooController {
       @RequestMapping("/list") public String list(...) { ... }
       @RequestMapping("/save") public String save(...) { ... }
       @RequestMapping("/delete") public String delete(...) { ... }
  }
  
  @Controller
  @RequestMapping(value = "/basketballController ")
  public class BasketballController {
       @RequestMapping("/list") public String list(...) { ... }
       @RequestMapping("/save") public String save(...) { ... }
       @RequestMapping("/delete") public String delete(...) { ... }
  }
  </code></pre>