title: How to override @RequestMapping in another controller?
body: <p>I need to extend an existing controller and add some functionality to it. But as a project requirement I can't touch in the original controller, the problem is that this controller have an <code>@RequestMapping</code> annotation on it. So my question is how can I make requests to <code>/someUrl</code> go to my new controller instead of the old one.</p>
  
  <p>here is a example just to clarify what I'm talking about:</p>
  
  <p>Original controller:</p>
  
  <pre><code>@Controller
  public class HelloWorldController {
  
      @RequestMapping("/helloWorld")
      public String helloWorld(Model model) {
          model.addAttribute("message", "Hello World!");
          return "helloWorld";
      }
  }
  </code></pre>
  
  <p>new Controller:</p>
  
  <pre><code>@Controller
  public class MyHelloWorldController {
  
      @RequestMapping("/helloWorld")
      public String helloWorld(Model model) {
          model.addAttribute("message", "Hello World from my new controller");
          // a lot of new logic
          return "helloWorld";
      }
  }
  </code></pre>
  
  <p>how can I override the original mapping without editing <code>HelloWorldController</code>?</p>