乐趣区

springboot 前端页面 通过 链接跳转到另一个html

两个问题

springboot 从一个页面跳到另一个页面 因为需要通过前端控制器, 所以有一种解决办法, 就是通过 controller 专门写一个 topage(), 通过 get 请求将跳转的页面传过去
controller 代码

@RequestMapping(value = “/toPage”,method = RequestMethod.GET)
public String toPage(HttpServletRequest request){
String url = request.getParameter(“url”);
return url;
}

页面代码

<li class=”active”><a href=”toPage?url=/vue/vue”> 链接 1</a></li>

2. 注意上面的 标签方法跳转的写法 ,

退出移动版