标签:tde turn bash system request print 拼接 用法 key
1.拼接字符串:
return "redirect:/page/second?param1=lay¶m2=lay2";
2.采用RedirectAttribute来传参数:
public String first(RedirectAttribute redirectAttribute){
redirectAttribute.addAttribute("param1", "lay");
return "redirect:/page/second";
}
3.RedirectAttribute—–addFlashAttribute()的用法:
@Controller
@RequestMapping("/page")
public class redirectDemo{
@RequestMapping("/first")
public String first(RedirectAttribute redirectAttribute){
redirectAttribute.addFlashAttibute("param1", "lay");
return "redirect:/page/second";
}
@RequestMapping("/second")
public String second(@ModelAttribute("param1") String param1){
System.out.println(param1);
return "second";
}
}
标签:tde turn bash system request print 拼接 用法 key
原文地址:http://www.cnblogs.com/ttsong/p/7103856.html