Howto: 如何更改Liferay context path
首先参考 Howto:windows上如何快速体验 liferay(http://liferay.iteye.com/group/topic/325)
确保liferay能够正常运行,假设新的context为myportal
将liferay关闭后准备按照以下步骤修改
1.将${TOMCAT_HOME}\webapps下ROOT目录改名为myportal
2.修改myportal下index.html
<meta content="0; url=/c" http-equiv="refresh"> <body onLoad="javascript:location.replace('/c')"> -> <meta content="0; url=c" http-equiv="refresh"> <body onLoad="javascript:location.replace('c')">
<context-param> <param-name>root_path</param-name> <param-value>/</param-value> </context-param> -> <context-param> <param-name>root_path</param-name> <param-value>/myportal</param-value> </context-param>
portal.ctx=/ -> portal.ctx=/myportal
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 %>"; 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 %>"; -> 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 %>"; 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 %>";
fileEl.setAttribute("url", "/image/image_gallery?img_id=" + image.getImageId());