当前位置: 代码迷 >> Web前端 >> weblogic服务器部署的程序,怎么直接通过IP访问(即URL中去掉工程名)
  详细解决方案

weblogic服务器部署的程序,怎么直接通过IP访问(即URL中去掉工程名)

热度:299   发布时间:2012-11-10 10:48:51.0
weblogic服务器部署的程序,如何直接通过IP访问(即URL中去掉工程名)

用weblogic部署的程序,怎么能够直接通过IP访问呢?

下面就是了

?

打开你的工程,看看webroot下的WEB-INF中有没有一个weblogic.xml文件。

1、如果没有,自己建一个,里面写上:

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
 <context-root>/</context-root>
</weblogic-web-app>

?里面的命名空间可根据自己的实际情况做改动,比如,如果你的工程较简单,可以这么简单的写:

?

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app 
?xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">
?<context-root>/</context-root>
</weblogic-web-app>

?对了,我用的是weblogic9.2,里面的xsd是9的,要根据自己的实际情况修改一下。

?

2、如果有weblogic.xml,那太好办了,直接把<context-root></context-root>中间的工程名去掉就可以了,

注意,不要把“/”给去掉。

?

偶了,访问吧。

?

  相关解决方案