在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萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章