title: Generic Spring MVC Controller with Inheritance
body: <p>Can I do the following in Spring MVC</p>
  
  <p>Suppose I have the Base GenericController as follows with one request mapping "/list"</p>
  
  <pre><code>@Controller
  public class GenericController&lt;T&gt;{
  
      @RequestMapping(method = RequestMethod.GET, value = "/list")
      public @ResponseBody List&lt;T&gt; getMyPage(){
          // returns list of T
      }
  
  }
  </code></pre>
  
  <p>Below are my two controllers</p>
  
  <pre><code>@Controller(value = "/page1")
  public class Page1Controller extends GenericController&lt;Page1&gt;{
  
  }
  
  @Controller(value = "/page2")
  public class Page2Controller extends GenericController&lt;Page2&gt;{
  
  }
  </code></pre>
  
  <p>Now will i be able to access the url "/page1/list" and "/page2/list" where first goes to Page1Controller and second goes to Page2Controller.</p>