我必須在第一個控制器的基礎上調用一個控制器,我必須調用另一個控制器...... 但這不是在春季3 mvc工作........春季控制器3
@Controller
public class ajaxContoller {
@RequestMapping(value="/mmiFacade",method=RequestMethod.POST)
public @ResponseBody String mmiFacade(@RequestParam String sType){
String forwardName = "";
if (sType.equalsIgnoreCase("Pincode")) {
forwardName = "forward:/pincodeAction";
} else if (sType.equalsIgnoreCase("Locality")) {
forwardName = "forward:/localityAction";
} else if (sType.equalsIgnoreCase("Patient")) {
forwardName = "forward:/patientAction";
} else if (sType.equalsIgnoreCase("Dlhdata")) {
forwardName = "forward:/Dlhdata";
}
return forward;
}
@RequestMapping(value="/pincodeAction",method=RequestMethod.POST)
public @ResponseBody String ajax(){
return "hiii";
}
@RequestMapping(value="/localityAction",method=RequestMethod.POST)
public @ResponseBody String ajax1(){
return "hiii1";
}
}
現在的問題是,我得到了一個錯誤..... org.springframework.beans.factory.BeanCreationException:創建名爲'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping# 0':bean初始化失敗;嵌套異常是java.lang.IllegalStateException:找到模糊映射。無法映射'mmiController'bean方法 – 2012-04-23 08:13:32
我得到一個錯誤java.lang.IllegalStateException:找到了不明確的映射。無法映射'mmiController'bean方法 – 2012-04-23 08:17:48
'找到不明確的映射'意味着您至少將2個方法映射到相同的路徑。檢查您的@RequestMapping定義 – Dima 2012-04-23 08:19:58