要配置Weblogic8的缺省应用,需要为相应的Web Application的WEB-INF目录下加上相应的配置文件信息。
1、对于以ear形式发布的web application,在application.xml中加入:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
<application id="Application_ID">
<display-name>ear包名</display-name>
<module id="WebModule_1139985114398">
<web>
<web-uri>yourAppName</web-uri>
<context-root>/</context-root>
</web>
</module>
<security-role id="SecurityRole_1151552182879">
<description>An administrator</description>
<role-name>everyone</role-name>
</security-role>
</application>
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, 创建好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" 是真实的文件名
1、对于以ear形式发布的web application,在application.xml中配置:
<web>
<web-uri>yourAppName</web-uri>
<context-root>mysite</context-root>
</web>
2、对于以目录形式发布的web application,需要在应用程序/WEB-INF/下的weblogic.xml文件中配置:
<weblogic-web-app>
<container-descriptor>
<index-directory-enabled>true</index-directory-enabled>
</container-descriptor>
<context-root>mysite</context-root>
</weblogic-web-app>
页面访问:http://localhost:7001/mysite
-------------------------------------------------------------------------------------
如果要把mysite设置成缺省的服务器名,
1、对于以ear形式发布的web application,在application.xml中配置:
<web>
<web-uri>yourAppName</web-uri>
<context-root>/</context-root>
</web>
2、对于以目录形式发布的web application,需要在应用程序/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/