title: class level mapping conflict in spring controller
body: <p>I just started learning spring boot, Please solve my doubt</p>
  
  <p>Suppose there are two controllers</p>
  
  <pre><code>@Controller
  @RequestMapping("A")
  public class A{
                 @RequestMapping("hi")
                 public String gethi(){
                        return "Hi";
                 }
  }
  </code></pre>
  
  <p>and another controller</p>
  
  <pre><code>@Controller
  @RequestMapping("B")
  public class B{
                 @RequestMapping("hello")
                 public String gethello(){
                        return "Hello";
                 }
  }
  </code></pre>
  
  <p>Suppose user is on index page and he clicks a link which is as follow</p>
  
  <pre><code>&lt;a href="A/hi"&gt;click&lt;/a&gt;
  </code></pre>
  
  <p>He specified controller A will recieve this request and respond to it accordingly.and the url will looks like something : www.abc.com/A/hi</p>
  
  <p>But if the user want to send a request to method of controller B
  suppose now he clicks on a link which is as follow</p>
  
  <pre><code>&lt;a href="B/hello"&gt;click&lt;/a&gt;
  </code></pre>
  
  <p>Now the user will recieve an error message. and the url becomes: www.abc.com/A/B/hello.</p>
  
  <p>But if a Add a * in class level request mapping like:</p>
  
  <pre><code>@Controller
  @RequestMapping("*/B")
  public class B{
  </code></pre>
  
  <p>then this method will execute.But still this url www.abc.com/A/B/hello not looks good.</p>