
在portal里加入struts的应用程序的主要步骤:
一:在portal中加入struts程序
(1) 将struts应用程序复制到你的webapp中的新目录中。你所选择的放置struts应用程序的目录将成为用于portal中应用程序的struts模块路径。比如,如果你的struts应用程序目录是test,那么你的应用程序的模块就是/test。将针对你的struts应用程序的struts-config.xml复制到web-inf/.pageflow-struts-generated/下,更改其文件名,命名规则为jpf-struts-config-<dir>.xml,本例子中为jpf-struts-config-test.xml. 使用这种命名规则允许用在 portal 中的行为 servlet动态地注册struts应用程序模块。
(2) 将下面的内容添加到struts的配置文件中:
<controller classname="com.bea.wlw.netui.pageflow.config.pageflowcontrollerconfig" multipartclass="com.bea.wlw.netui.pageflow.upload.pageflowmultipartrequesthandler" inputforward="true" processorclass="com.bea.wlw.netui.pageflow.pageflowrequestprocessor">
<set-property value="true" property="isreturntopagedisabled"/>
<set-property value="true" property="isreturntoactiondisabled"/>
</controller>
(3) 将相应的struts里所需要的java文件copy到web-inf/src下面,本例中为teststruts里.
(4) 对新加入的jpf-struts-config-<dir>.xml根据目录做相应的调整,使之与workshop中的目录结构一致.
<?xml version="1.0" encoding="utf-8"?>
<!doctype struts-config public "-//apache software foundation//dtd struts configuration 1.1//en" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<!-- generated from /test/testcontroller.jpf on thu mar 30 23:22:05 cst 2006 -->
<struts-config>
<form-beans/>
<global-exceptions/>
<global-forwards/>
<form-beans>
<form-bean name="useractionform" type="teststruts.useractionform" />
</form-beans>
<action-mappings>
<!--action validate="false" scope="request" type="test.testcontroller" path="/begin">
<forward path="/index.jsp" name="success"/>
</action-->
<action validate="false" scope="request" path="/startaction" type="teststruts.startaction">
<forward name="success" path="/login.jsp" />
</action>
<action validate="false" scope="request" name="useractionform" path="/loginaction" type="teststruts.loginaction">
<forward name="success" path="/success.jsp" />
<forward name="err" path="/err.jsp" />
</action>
</action-mappings>
<controller classname="com.bea.wlw.netui.pageflow.config.pageflowcontrollerconfig" multipartclass="com.bea.wlw.netui.pageflow.upload.pageflowmultipartrequesthandler" inputforward="true" processorclass="com.bea.wlw.netui.pageflow.pageflowrequestprocessor">
<set-property value="true" property="isreturntopagedisabled"/>
<set-property value="true" property="isreturntoactiondisabled"/>
</controller>
</struts-config>
二.将struts程序配置为portlets
在test目录下新建portlets

选择建立struts portlets
注意:要为struts生成portlet,struts里的必须以action作为入口,不能以jsp作为其入口.
为struts选择module uri,本例中选择test目录,即生成的portlet放在test目录下.
选择struts的config文件
本例中选择jpf-struts-config-test.xml

加入配置文件

选择一个action作为portlet的入口
然后将生成的portlets加入portal即可.
闽公网安备 35060202000074号