controller:
/**
* 进入邀请页面,这种方式不用配置前后缀
*/
@RequestMapping(value = "/invitationPage", method = {RequestMethod.POST, RequestMethod.GET})
public String invitationPage(@RequestParam("oldUserId") long oldUserId) {
return "redirect:welcome.html?oldUserId=" + oldUserId;
}
资源文件路径:
welcome.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
this is my olduserId .is ${oldUserId}
</body>
<script>
var name = '${oldUserId}';
alert(name);
</script>
</html>