12.18 jsp为什么路径是正确的,跳转后确是404

Posted on 2020-12-18 16:33  ***Pepsi***  阅读(252)  评论(0)    收藏  举报

 

jsp为什么路径是正确的,跳转后确是404

<form action="student/save.do" method="post">

比如我要提交到这个地址,却发现怎么提交都是找不到网页。

解决方法是不要用相对路径,用绝对路径。加上

${pageContext.request.contextPath}

 

<form action="${pageContext.request.contextPath}/student/save.do" method="post">

这样就可以提交到了。

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3