1.点击编辑,页面跳转到edit.html
return [
'<a class="btn active" href="javascript:;" onclick="School.edit(\'ID\')">编辑</a>',
'<a class="btn active" href="#">档案</a>',
'<a class="btn btn-default" href="#">记录</a>',
'<a class="btn active" href="#">准入</a>'
].join('').replace(/ID/g, value);
School.eidt
edit: function(id) {
var url = '/' + id + '/new'; // 1/new
alert('...id:' + url);
location.href = url;
}
new.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>编辑</title>
</head>
<body>
编辑页面
</body>
</html>
SchoolController
@RequestMapping("/{id}/new") //{id} 占位符
public String newEidt(@PathVariable int id) {
System.out.println(".....id:" + id);
return "new";
}