HTTP ERROR 404
Problem accessing /strutsByMavenJettyPlugin/index.jsp. Reason:
Not Found
Powered by Jetty:// 9.4.7.v20170914
mvn jetty:run 后
访问 http://localhost:8080/项目名/index.jsp 出现上述问题:
原因是:
pom.xml中:
<webApp>
<contextPath>${project.artifactId}</contextPath>
</webApp>
contextPath 元素 缺少 ‘/’
改为:
<webApp>
<contextPath>/${project.artifactId}</contextPath>
</webApp>
问题消失。
官方文档:
http://www.eclipse.org/jetty/documentation/current/jetty-maven-plugin.html#configuring-your-webapp