我使用的是 IntelliJ Ultimate 版本和 Tomcat 9。
当我启动服务器时,我遇到了 URL 问题,它运行带有前缀 (myweb
) 的 URL,这是我的项目名称和 (_war_exploded
)。
localhost:8080/myweb_war_exploded/
然后,当我运行以下链接时,我会创建另一个页面,例如登录:
localhost:8080/login
它给了我以下错误:
HTTP Status 404 – Not Found
Type Status Report
Message JSP file [/login.jsp] not found
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
Apache Tomcat/9.0.35
最佳答案
当您输入 url localhost:8080/myweb_war_exploded/时,它会尝试加载 index.html、index.jsp 。所以尝试 localhost:8080/myweb_war_exploded/login.jsp 或以下选项
1.您可以将login.jsp 的名称更改为index.jsp(或)
2.在conf/web.xml中添加新条目login.jsp(在页面末尾,您将找到一组欢迎文件标签)--> localhost:8080/myweb_war_exploded/- 现在将加载login.jsp(如果没有索引) .html 或index.jsp 在那里)
关于java - intellij 中的 URL myweb_war_exploded 出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62230476/