学海无涯

记录我的程序人生...

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
要配置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里面配置:
布署成Web 应用程序模块, 并在应用程序目录下的WEB-INF目录下加入weblogic.xml文件, 文件内容如下:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.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 that the application.xml context-root takes precedent over the weblogic.xml value.)



安装WebLogic8.1, 创建好myDomain域.
-------------------------------------------------------------------------------------
打开域目录下(myDomain)的config.xml文件.在最后的</Domain>语句前加入下列语句:
<Application Name="mysite" Path="H:\" StagingMode="nostage" TwoPhase="true">
<WebAppComponent Name="WebApp" Targets="myserver" URI="mysite"/>
</Application>
Path="D:\" 是URI的路径
Name="mysite" 是虚拟目录名
URI="mysite" 是真实的文件名
 
页面访问:http://localhost:7001/mysite
-------------------------------------------------------------------------------------
如果要把mysite设置成缺省的服务器名,需要在应用程序/WEB-INF/下的weblogic.xml文件中配置:
<weblogic-web-app>
  <container-descriptor>
    <index-directory-enabled>true</index-directory-enabled>
  </container-descriptor>
  <context-root>/</context-root>
</weblogic-web-app>
 
页面访问:http://localhost:7001/

posted on 2005-09-28 15:06  josson  阅读(1260)  评论(1编辑  收藏  举报