修改weblogic部署的应用名称

通过weblogic管理后台console进行发布本地项目的时候,它会默认以WEB-INF的上一级目录作为访问路径,如,假如你的项目WEB-INF目录的上一层是WebRoot,那么发布后,访问的路径默认是:http://hostname:port/WebRoot,怎么样才能把WebRoot修改成其他内容呢? 解决方法就是在WEB-INF目录下增加weblogic.xml文件,内容如下: <weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90" 
xmlns:j2ee="http://java.sun.com/xml/ns/j2ee" 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"> 
<context-root>/test</context-root> 
<container-descriptor> 
   <prefer-web-inf-classes>true</prefer-web-inf-classes> 
</container-descriptor> 
</weblogic-web-app> 
其中<context-root>标签之间的内容就是替换WebRoot的内容,只要改成你相应的内容即可,此时的访问变为http://hostname:port/test

 

备注:本文转自http://www.cnblogs.com/hanxianlong/p/3344546.html

 

posted @ 2014-07-28 09:52  漫步去旅游  阅读(269)  评论(0编辑  收藏  举报