java - intellij 中的 URL myweb_war_exploded 出现问题

标签 java tomcat url intellij-idea

我使用的是 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/

相关文章:

javascript - 替换当前 url 而不重新加载页面

html - 如何使用 'cite' 属性仅使用 CSS 显示 URL?

java - 如何在 Eclipse 中安装 .tar.gz 插件

java - 您如何从 servlet 内省(introspection) web.xml?

Java输入: Scanner or IOException

java - 为什么当有很多请求时应用程序会挂起?

java - Activity 中的转换界面

spring-mvc - spring 安全与某些东西的冲突(也许是 spring mvc)

java - Tomcat 8 无法创建 Java jli.dll

security - FBML 应用程序在 HTTPS 下失败