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

创建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

发布了13 篇原创文章 · 获赞 3 · 访问量 9万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章