我有一个来自ajax请求的简单控制器。它工作但我想返回很多东西,不仅仅是List TestFlow.getFlow(flowName);
@RequestMapping(value = "/execute-flow/getFlow" , method = RequestMethod.POST)
public @ResponseBody List<String> getFlow(@RequestParam("flowName") String flowName) {
return TestFlow.getFlow(flowName);
}
我可以将多个内容返回到ajax帖子吗?
例如:
@RequestMapping(value = "/execute-flow/getFlow" , method = RequestMethod.POST)
public @ResponseBody List<String> getFlow(@RequestParam("flowName") String flowName) {
return TestFlow.getFlow(flowName);
return TestFlow.getInputs(flowName);
return TestFlow.getCode(flowName);
}
答案 0 :(得分:0)
不确定你到底发生了什么,但是
return Arrays.asList(
TestFlow.getFlow(flowName),
TestFlow.getInputs(flowName),
TestFlow.getCode(flowName));
只要所有这些都属于同一类型(String),就可以工作。