當(dāng)前項(xiàng)目是使用Struts Portlet Framework 5.0的,Struts 是1.1版本。原本打算在RAD 7里面按照向?qū)鹨粋€(gè)Struts Portlet項(xiàng)目,然后再把Modules 一個(gè)個(gè)遷移過(guò)去,但是其好項(xiàng)目后一看傻掉了,是Struts 2.0的框架。于是,只好按照下面的步驟一步一步遷移了。
l 在Websphere Portal的安裝目錄下找到installableApps目錄,里面有一個(gè)SPFLegacyBlank.war,將它導(dǎo)入到RAD的工作空間中,我們將用其中的文件作為模板。
l 從模板應(yīng)用程序復(fù)制 META-INF/services/org.apache.commons.logging.LogFactory 文件到遷移項(xiàng)目中。
l 將以下 JAR 文件從模板應(yīng)用程序復(fù)制到遷移項(xiàng)目的 WEB-INF/lib 目錄中,如果這些 JAR 文件已經(jīng)存在,那么覆蓋它們。
u commons-beanutils.jar
u commons-collections.jar
u commons-digester.jar
u commons-fileupload.jar
u commons-lang.jar
u commons-validator.jar
u jakarta-oro.jar
u PortalStruts.jar
u PortalStrutsCommon.jar
u PortalStrutsTags.jar
u struts.jar
u struts-legacy.jar
u StrutsUpdateForPortal.jar
u wp.struts-commons-logging.jar
u wp.struts.tlds.common.jar
l 從遷移項(xiàng)目的 WEB-INF/lib 目錄中刪除以下文件:
u commons-dpcp.jar
u commons-logging.jar
u commons-pool.jar
u commons-resources.jar
u commons-services.jar
u jdbc2_0-stdext.jar
l 刪除遷移項(xiàng)目中的struts TLD文件,并從web.xml中移除這些TLD的引用
u struts-bean.tld
u struts-chtml.tld
u struts-html.tld
u struts-logic.tld
u struts-nested.tld
u struts-portal-html.tld
u struts-portal-wml.tld
u struts-template.tld
u struts-tiles.tld
u struts-wml.tld
l 修改JSP中對(duì)Struts, JSTL的URI的約定(非常重要,否則會(huì)出現(xiàn)頁(yè)面無(wú)法顯示的情況)。例如,
<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
需要改為
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
l
u http://struts.apache.org/tags-bean
u http://struts.apache.org/tags-chtml
u http://struts.apache.org/tags-html
u http://struts.apache.org/tags-logic
u http://struts.apache.org/tags-nested
u http://portal/struts/tags-html-1.0
u http://portal/struts/tags-wml-1.0
u http://struts.apache.org/tags-template
u http://struts.apache.org/tags-tiles
u http://struts.apache.org/tags-wml-1.0
l 在項(xiàng)目portler.xml中移除
<config-param>
<param-name>FilterChain</param-name>
<param-value>StrutsTranscoding</param-value></config-param>
完成上述步驟以后,移植就算完成了。
另外附加一個(gè)Websphere 5.0移植含Web項(xiàng)目的EAR到Websphere 6.0上的一個(gè)小帖士,是在部署期間很莫名的一個(gè)錯(cuò)誤:
IWAE0022E Exception occurred loading deployment descriptor for module ‘XXX_Web’ in EAR file XXX_EAR
而在RAD7的Websphere6的測(cè)試服務(wù)器上部署的時(shí)候并未出現(xiàn)這個(gè)錯(cuò)誤,仔細(xì)檢查過(guò)部署描述文件也沒(méi)發(fā)現(xiàn)有什么問(wèn)題。后來(lái),不知算不算運(yùn)氣好,終于找到原因,原來(lái)問(wèn)題出在Web項(xiàng)目的web.xml,移除其中所有的<Servlet>下的<display-name>后問(wèn)題得以解決。
參考資料:http://publib.boulder.ibm.com/infocenter/wpdoc/v6r0/index.jsp?topic=/com.ibm.wp.ent.doc/wpf/mig_struts.html