相对路径
href=”cake/list”
跳转到cake/list
点击两次:跳转出错
http://localhost:8080/cakeshop/cake/cake/list
绝对路径
${pageContext.request.contextPath }
1. 优点:
它的作用是取出部署应用程序的名字,这样不管如何部署,所用的路径都是正确的
2. 转发重定向:
return “redirect:/front-end/index.jsp”;
使用转发重定向,路径显示会比较规范。