Servlets 在JBoss中剪切Servlet url

Servlets 在JBoss中剪切Servlet url,servlets,jboss,jboss7.x,Servlets,Jboss,Jboss7.x,我有一个应用程序正在JBoss7上运行。它的URL是http://localhost:8080/archive/app。如何使其看起来http://localhost:8080/app或http://localhost/app PS./archive表示archive.war1)删除欢迎根目录。在standalone.xml集合中: <virtual-server name="default-host" enable-welcome-root="false"> 2)设置上下文根

我有一个应用程序正在JBoss7上运行。它的URL是
http://localhost:8080/archive/app
。如何使其看起来
http://localhost:8080/app
http://localhost/app

PS.
/archive
表示
archive.war
1)删除欢迎根目录。在standalone.xml集合中:

<virtual-server name="default-host" enable-welcome-root="false">

2)设置上下文根目录。在archive.war中,在web-INF文件夹中添加jboss-web.xml文件:

<?xml version="1.0"?>
<jboss-web>
   <context-root>/</context-root>
</jboss-web>

/
3)将http端口设置为80。在standalone.xml文件中更改:

请记住,如果您的服务器在Linux机器上运行,则必须由root用户启动,才能使用1024以下的端口。在这种情况下,您可以通过iptables从80重定向到8080,而无需更改standalone.xml套接字绑定