Weblogic8.1缺省應用配置

在Weblogic7中,要配置某個應用作爲缺省應用(DefaultWebApplication)的話,只需要在控制檯(Console)界面上進行設置即可。但Weblogic8.1的控制檯裏面似乎找不到這個選項了。直接修改config.xml也無法達到目的。

要配置Weblogic8.1的缺省應用,需要爲相應的Web Application的WEB-INF目錄下加上相應的配置文件信息。

1、對於以ear形式發佈的web application,在application.xml中加入:
<web>
  <web-uri>yourAppName</web-uri>
  <context-root>/</context-root>
</web>

2、對於以目錄形式發佈的web application,可以在weblogic.xml裏面配置:

<!DOCTYPEweblogic-web-appPUBLIC "-//BEA Systems, Inc.//DTD Web Application8.1//EN""http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd">

<weblogic-web-app>
  <container-descriptor>
    <index-directory-enabled>true</index-directory-enabled>
  </container-descriptor>
  <context-root>/</context-root>
</weblogic-web-app>

注 意:application.xml裏面的配置將會覆蓋掉weblogic.xml的配置信息(Note thattheapplication.xml context-root takes precedent over theweblogic.xmlvalue.)

bea關於default web application的說明:

http://e-docs.bea.com/wls/docs81/ConsoleHelp/web_applications.html

Designating a Default Web Application

Thedefault Web Application is presented to clients who do notspecify a URI(or specify "/" as the URI). To deploy a Web Applicationas a defaultWeb Application, set the value of the context-root elementto "/" in itsdeployment descriptor.

You can specify the context-root elementin the weblogic.xmldeployment descriptor for Web Applications that arepackaged as a .wararchive or exploded .war directory. If you packagethe Web Applicationas part of an Enterprise Application (.ear archiveor exploded .ear),specify the context-root in application.xml. Notethat theapplication.xml context-root takes precedent over theweblogic.xmlvalue.

Deploy the application using the instructions in Deploying a New Web Application.

To deploy a Web Application as part of an .ear archive or exploded .ear, see Deploying WebLogic Server Applications.

轉載請保留原始鏈接:http://www.zeali.net/blog/entry.php?id=135

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章