且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

源服务器没有找到目标资源的当前表示,或者不愿意透露一个存在.关于部署到 tomcat

更新时间:2022-03-05 17:36:54

我曾多次为这个问题苦苦挣扎.

I struggled with this problem many times.

我目前使用的解决方案是让 web 应用程序(或您保存视图如 jsp 的文件夹)处于部署程序集之下.

The solution I am currently using is weather the webapp(or the folder where you kept the views like jsp) is under deployment assembly.

这样做 右键单击项目>构建路径配置构建路径 >部署组件添加(右侧)>文件夹 >(添加你的jsp文件夹.默认情况下它是src/main/webapp)

To do so Right click on the project > Build Path > Configure Build path > Deployment Assembly > Add(right hand side) > Folder > (add your jsp folder. In default case it is src/main/webapp)

在您正确完成所有操作后,您也可能会收到此错误,但在 JSP 上,您将锚标记放置为旧方式(如果它可以帮助其他遇到相同问题的人,我将添加此内容).

You could also get this error after you did everything correct but on the JSP you put the anchor tag the old fashion(I am adding this incase if it help anybody else with the same issue).

我在 jsp 上有以下语法.<a href="/mappedpath">TakeMeToTheController</a> 并且我一直看到问题中提到的错误.但是,将标签更改为如下所示的标签解决了问题.

I had the following syntax on the jsp. <a href="/mappedpath">TakeMeToTheController</a> and I kept seeing the error mentioned in the question. However changing the tag into the one shown below solved the issue.

<a href=" <spring:url value="/mappedpath" /> ">TakeMeToTheController</a>