【发布时间】:2013-08-09 06:44:11
【问题描述】:
我在 eclipse 中有一个 web 动态项目,在 webapps 文件夹中有 index.html,我可以通过以下方式访问它:
http://localhost:8080/javaTest
我想通过以下方式访问我的应用程序:
http://localhost:8080
我尝试通过右键单击项目->属性->Web 项目设置将上下文根更改为“/”,但在http://localhost:8080/ 上找不到请求的资源,并且应用程序仍在http://localhost:8080/javaTest 上运行。
这是我的 web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>javaTest</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
编辑:服务器 - tomcat 7.0.34
【问题讨论】:
-
您使用的是哪个 J2EE 服务器?
标签: url jakarta-ee web