从一个控制器重定向到另一个控制器,车身和标头变动



i具有编码请求主体的通用控制器。我希望该控制器对车身进行解码,并将该解码的车身设置为特定控制器。下面是我的控制器

@RequestMapping(value = "/{type}", method = RequestMethod.POST)
public String save(@RequestBody String base64Body, @PathVariable("type") String type) throws IOException {
    String json = decompress(Base64.getDecoder().decode(base64Body));
    //now I'd like set json to request body, change header, and redirect to "type" controller
    return format("redirect:/%s/save", type);
}

上面的代码应该从addres/type/save用解码的主体来调用我的控制器,甚至有可能吗?谢谢

format("redirect:/%s/save/json=%s", type, json);

或只是自动将重定向目标控制器自动到主距离,并直接致电无HTTP传输的方法。

最新更新