我有一个/views/home/index.jsp,它有一个链接可以从另一个控制器调用另一个页面。
views / home / index.jsp(http://localhost:8080/mywebsite/home
< - 此控制器/方法调用“home / index”)
<li><a href="${pageContext.request.contextPath}/home2" target="_blank">home2</a></li>
home.index需要重定向的页面由home2 controller托管:
views / home2 / index.jsp(http://localhost:8080/mywebsite/home2
&lt; - 此控制器/方法调用“home2 / index”)
而不是使用:
href="${pageContext.request.contextPath}/home2"
我如何只使用相对于链接的东西,例如:
href="/home2"
答案 0 :(得分:0)
per @Atais:
“只是没有斜线?所以它将解析localhost:8080 / mywebsite / home2地址”