编辑页面

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/lucasmaluping/article/details/101265057

1.点击编辑,页面跳转到edit.html

return [
                '<a class="btn active" href="javascript:;" οnclick="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";
    }

猜你喜欢

转载自blog.csdn.net/lucasmaluping/article/details/101265057