将弹簧中的属性从控制器传递到外部URL并返回

时间:2016-09-30 15:16:12

标签: java spring

我有一些外部网址付款。付款完成后,它会重定向给我。

@RequestMapping(value = "/first", method = RequestMethod.GET)
public String first(@RequestParam("id") String id) {
  doSomething(id);
  return "redirect:/externalurl"
}

// This method is called from external url
@RequestMapping(value = "/second", method = RequestMethod.GET)
public String second() {
  // I want to get here id from first call 
}

是否有可能以某种方式使用RedirectAttributes或其他类似的做法,例如在first()方法中添加它并在second()方法中获取它?

0 个答案:

没有答案