【发布时间】:2020-04-25 22:20:18
【问题描述】:
我在 Eclipse 上创建了一个名为 JavaEEWebContent 的动态 Web 项目。项目的文件结构如下所示。
当我做“在服务器上运行”时编译后,它运行良好。
当我转到链接 http://localhost:8080/JavaEEWebContent/ 时,它可以正常工作并显示主页(在我的情况下是 index.html)。
问题:
当我转到http://localhost:8080 时,它会显示
我知道http://localhost:8080 的登录页面看起来像这样:
知道为什么它不适合我或可能出了什么问题吗?
我也在使用Tomcat 8.5.54。
如果有帮助,这就是我的 web.xml 的样子:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<welcome-file-list>
<welcome-file>index3.html</welcome-file>
<welcome-file>index2.html</welcome-file>
<welcome-file>index2.html</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>addNumbers</servlet-name>
<servlet-class>com.servlet.addNumbers.AddNumbers</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>addNumbers</servlet-name>
<url-pattern>/addNumbers</url-pattern>
</servlet-mapping>
</web-app>
请帮忙。
【问题讨论】:
标签: java eclipse tomcat tomcat8