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

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

 

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

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

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

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

${pageContext.request.contextPath}

 

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

这样就可以提交到了。

Copyright © 2024 ***Pepsi***
Powered by .NET 8.0 on Kubernetes