继承中,父类有重载方法

A类继承B类,B类中有方法重载,例如:

public void JsonSuccess(String Info) {

Map<String,Object> EchoMap = new HashMap<String,Object>();

EchoMap.put("status", 1);

EchoMap.put("info", Info);

renderJson(EchoMap);

}


public void JsonSuccess(String Info,Object Data) {

Map<String,Object> EchoMap = new HashMap<String,Object>();

EchoMap.put("status", 1);

EchoMap.put("info", Info);

EchoMap.put("data", Data);

renderJson(EchoMap);

}

则运行时报错can not be mapped, actionKey "/JsonSuccess" is already in use.

评论区

JFinal

2018-11-09 15:49

在方法上添加 @NotAction 即可

Aizen

2018-11-09 15:57

热门反馈

扫码入社