从j2ee web应用程序URL中删除项目名称

从j2ee web应用程序URL中删除项目名称,url,jakarta-ee,web,Url,Jakarta Ee,Web,我在eclipse中有一个web动态项目,在webapps文件夹中有index.html,我可以通过以下方式访问它: http://localhost:8080/javaTest 我想通过以下方式访问我的应用程序: http://localhost:8080 我试图通过右键单击project->properties->Web project Settings将上下文根目录更改为“/”,但在http://localhost:8080/找不到请求的资源,应用程序仍在运行http://localh

我在eclipse中有一个web动态项目,在webapps文件夹中有index.html,我可以通过以下方式访问它:

http://localhost:8080/javaTest
我想通过以下方式访问我的应用程序:

http://localhost:8080
我试图通过右键单击project->properties->Web project Settings将上下文根目录更改为“/”,但在
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>

javaTest
index.html
index.htm
index.jsp
default.html
default.htm
default.jsp

编辑:服务器-tomcat 7.0.34

从tomcat的wiki中使用此方法


我通过下面的链接解决了这个问题


如果要从URL中删除应用程序名或项目名,请务必按照所有步骤进行操作,jsut change在tomcat服务器文件conf/server.xml文件中

appBase=“webapps”

删除“webapps”并仅使用“/”

appBase=“/”


现在您检查一下您使用的是哪个J2EE服务器?请简要描述一下链接的内容,以防它被破坏