Spring MVC: got “ambiguous mapping found” error when extending annotated base controller with @Controller

时光毁灭记忆、已成空白 提交于 2019-12-12 01:59:09

问题


I am using Spring MVC 3.2.4. I want to extend an existing annotated base controller to override some existing methods. Here is what I want to do,

/**Base Controller**/
 @controller
 public class BaseController {

  @RequestMapping(value="/process")
  public String doStuff(){
   //do something
  }
 }

/**Child Controller**/
@controller
public class ChildController extends BaseController {

  @RequestMapping(value="/specicalProcess")
  public String doStuff(){
  //do special thing
  super.doStuff();
 }
}

But I got "ambiguous mapping found" error. I wonder if Spring MVC doesn't support overriding a super method with @RequestMapping annotation and how I can extend annotated base controller. In my case, I don't want to remove all annotation from base controller to make it work. Any thoughts? Many thanks in advance.

来源:https://stackoverflow.com/questions/22401815/spring-mvc-got-ambiguous-mapping-found-error-when-extending-annotated-base-co

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!