在JBoss AS 7中将项目指定至'/'根目录

来源:互联网 发布:erp软件测试六部曲 编辑:程序博客网 时间:2024/05/22 13:52

创建WEB-INF/jboss-web.xml文件,全部内容如下:

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

修改/jboss-as-7.0.0.Final/standalone/configuration/standalone.xml文件
在文件的最后找到

<subsystem xmlns="urn:jboss:domain:web:1.0" default-virtual-server="default-host">    <connector name="http" scheme="http" protocol="HTTP/1.1" socket-binding="http"/>    <virtual-server name="default-host" enable-welcome-root="true">      <alias name="localhost" />      <alias name="example.com" />    </virtual-server>  </subsystem> 

将enable-welcome-root="true"删除或改为enable-welcome-root="false"
否则启动时会抛出"Child container with name  already exists"错误


转自:http://exceedsun218.iteye.com/blog/1150927

0 0