@Controller
@RequestMapping("/asdf")
public abstract class ASDFController {
@RequestMapping("/asdf")
public abstract class ASDFController {
}
@Controller
@RequestMapping("/a")
public class A extends ASDFController {
@RequestMapping(value="/delete", method=RequestMethod.GET)
@ResponseBody
public int delete() {
return -1;
}
}
@Controller
public class B extends ASDFController {
@RequestMapping(value="/b/delete", method=RequestMethod.GET)
@ResponseBody
public int delete() {
return -1;
}
}
Mapped "{[/a/delete],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}"
Mapped "{[/asdf/b/delete],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}"
如果子类在类上没有添加RequestMapping注解,子类中的方法会自动带上父类设置的RequestMapping的值