---
title: "weblogic中如果使用80端口和根目录作为应用的默认目录"
author: "gongstring"
date: "2010-07-23T19:29:51Z"
tags: []
categories: ["编程语言"]
slug: "weblogic-80"
draft: false
lastmod: "2010-07-23T19:29:51Z"
id: 720030
url: "https://gongstring.iteye.com/blog/720030"
---

使用根目录作为默认目录，需要新建一个工程可以叫做index，然后在在WEB-INF目录下面新建一个weblogic.xml，内容是

&lt;!-- &lt;br /&gt; &lt;br /&gt; Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt; http://www.CodeHighlighter.com/&lt;br /&gt; &lt;br /&gt; --&gt;&lt;! 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" &gt;

&lt; weblogic-web-app &gt;  
&lt; context-root &gt; / &lt;/ context-root &gt;

&lt;/ weblogic-web-app &gt;

之后，在web.xml的welcome-file中指定一个跳转页面比如是index.jsp，之后想默认跳转到任何应用都可以通过这个跳转页进行。  
监听80端口，需要在相关域下面的config目录中修改config.xml，例如：

&lt;!-- &lt;br /&gt; &lt;br /&gt; Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt; http://www.CodeHighlighter.com/&lt;br /&gt; &lt;br /&gt; --&gt;   &lt; server &gt;  
     &lt; name &gt; demo &lt;/ name &gt;  
     &lt; listen-port &gt; 80 &lt;/ listen-port &gt;  
     &lt; listen-address &gt; 192.168.1.2 &lt;/ listen-address &gt;  
   &lt;/ server &gt;

默认端口不是80，只需要将listen-port改成80即可。