如何更改Liferay context path

首先参考 Howto:windows上如何快速体验 liferay(http://liferay.javaeye.com/group/topic/325)
确保liferay能够正常运行,假设新的context为myportal
将liferay关闭后准备按照以下步骤修改

1.将${TOMCAT_HOME}/webapps下ROOT目录改名为myportal

2.修改myportal下index.html

代码
  1. <meta content="0; url=/c" http-equiv="refresh">    
  2. <body onLoad="javascript:location.replace('/c')">    
  3. ->    
  4. <meta content="0; url=c" http-equiv="refresh">    
  5. <body onLoad="javascript:location.replace('c')">   
<script type="text/javascript">render_code();</script>

 

3.修改myportal/WEB-INF/web.xml

代码
  1. <context-param>    
  2. <param-name>root_path</param-name>    
  3. <param-value>/</param-value>    
  4. </context-param>    
  5. ->    
  6. <context-param>    
  7. <param-name>root_path</param-name>    
  8. <param-value>/myportal</param-value>    
  9. </context-param>  
<script type="text/javascript">render_code();</script>

 

4.修改myportal/WEB-INF/classes/portal-ext.properties

代码
  1. portal.ctx=/    
  2. ->    
  3. portal.ctx=/myportal  
<script type="text/javascript">render_code();</script>

 

5.修改myportal/html/js/editor/fckeditor/fckconfig.jsp

 

代码
  1. FCKConfig.LinkBrowserURL = FCKConfig.BasePath + "filemanager/browser/liferay/browser.html?Connector=/html/js/editor/fckeditor/editor/filemanager/browser/liferay/connectors/jsp/connector?p_l_id=<%= plid %>";    
  2. FCKConfig.ImageBrowserURL = FCKConfig.BasePath + "filemanager/browser/liferay/browser.html?Type=Image&Connector=/html/js/editor/fckeditor/editor/filemanager/browser/liferay/connectors/jsp/connector?p_l_id=<%= plid %>";    
  3. ->    
  4. FCKConfig.LinkBrowserURL = FCKConfig.BasePath + "filemanager/browser/liferay/browser.html?Connector=/myportal/html/js/editor/fckeditor/editor/filemanager/browser/liferay/connectors/jsp/connector?p_l_id=<%= plid %>";    
  5. FCKConfig.ImageBrowserURL = FCKConfig.BasePath + "filemanager/browser/liferay/browser.html?Type=Image&Connector=/myportal/html/js/editor/fckeditor/editor/filemanager/browser/liferay/connectors/jsp/connector?p_l_id=<%= plid %>";  
<script type="text/javascript">render_code();</script>

 

重新启动liferay
http://localhost:8080/myportal查看新设置是否正常

另:
由于fckeditor中的某些代码被硬编码在java文件中,所以使用fckeditor时浏览服务器图像和浏览器文件时返回的url不正确
比如某个图像url是/myportal/image/image_gallery?img_id=1001,但是在使用fckeditor时返回的是/image/image_gallery?img_id=1001
见ImageCommandReceiver.java

代码
  1. fileEl.setAttribute("url""/image/image_gallery?img_id=" + image.getImageId());  
<script type="text/javascript">render_code();</script>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值