templates中的页面,不能直接进行超链接跳转,受到保护。
就像WIN-INF中的页面一样受到保护,不能在地址栏直接进行访问。
如果需要,可以在Controller中进行重定向跳转。
不能跳转
<body>
<a href="../addStudent.html">添加</a>
<table>
<thead>
<tr>
<th>学号</th>
<th>姓名</th>
<th>年龄</th>
<th>性别</th>
<th>操作</th>
</tr>
</thead>
换成
<a href="/studentController/add">添加</a>
Controller中添加
@RequestMapping("/add")
public String add(){
return "addStudent";
}